mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1130678 - Fix messaging ordering issue in broadcastchannel tests, r=mchang
This commit is contained in:
parent
796be0697d
commit
b0f8f14dfc
@ -2,8 +2,8 @@ onconnect = function(evt) {
|
||||
evt.ports[0].onmessage = function(evt) {
|
||||
var bc = new BroadcastChannel('foobar');
|
||||
bc.addEventListener('message', function(event) {
|
||||
evt.target.postMessage(event.data == "hello world from the window" ? "OK" : "KO");
|
||||
bc.postMessage("hello world from the worker");
|
||||
bc.postMessage(event.data == "hello world from the window" ?
|
||||
"hello world from the worker" : "KO");
|
||||
bc.close();
|
||||
}, false);
|
||||
|
||||
|
@ -29,8 +29,6 @@ function runTests() {
|
||||
if (event.data == "READY") {
|
||||
ok(true, "SharedWorker is ready!");
|
||||
bc.postMessage('hello world from the window');
|
||||
} else if(event.data == "OK") {
|
||||
ok(true, "SharedWorker has received the message");
|
||||
} else {
|
||||
ok(false, "Something wrong happened");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user