Bug 1274265 - Move the final check of browser_broadcastchannel.js into content. r=baku, a=test-only
authorJonathan Hao <jhao@mozilla.com>
Tue, 26 Jul 2016 20:35:00 -0400
changeset 325584 7d30a0449e626b23dbd45dc2837aef386c2de0dc
parent 325583 6ec9fc7f1edd7bee384f6ec8614a41c61d306a52
child 325585 5e62247fa0438d7c5218fc8437849c16dd3ffde5
push id9843
push userryanvm@gmail.com
push dateFri, 29 Jul 2016 20:53:22 +0000
treeherdermozilla-aurora@42c3abe40b3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, test-only
bugs1274265
milestone49.0a2
Bug 1274265 - Move the final check of browser_broadcastchannel.js into content. r=baku, a=test-only
browser/components/contextualidentity/test/browser/browser_broadcastchannel.js
--- a/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js
+++ b/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js
@@ -58,24 +58,23 @@ add_task(function* test() {
         sender.browser,
         { name: channelName, message: sender.message },
         function (opts) {
           let bc = new content.window.BroadcastChannel(opts.name);
           bc.postMessage(opts.message);
         });
   }
 
-  // make sure we have received a message
-  yield ContentTask.spawn(receiver.browser, channelName,
-    function* (name) {
-      yield content.window.testPromise.then(function() {});
+  // Since sender1 sends before sender2, if the title is exactly
+  // sender2's message, sender1's message must've been blocked
+  yield ContentTask.spawn(receiver.browser, sender2.message,
+    function* (message) {
+      yield content.window.testPromise.then(function() {
+        is(content.document.title, message,
+           "should only receive messages from the same user context");
+      });
     }
   );
 
-  // Since sender1 sends before sender2, if the title is exactly
-  // sender2's message, sender1's message must've been blocked
-  is(receiver.browser.contentDocument.title, sender2.message,
-      "should only receive messages from the same user context");
-
   gBrowser.removeTab(sender1.tab);
   gBrowser.removeTab(sender2.tab);
   gBrowser.removeTab(receiver.tab);
 });