Bug 1360796 fix intermittent assert, r=mattw
authorShane Caraveo <scaraveo@mozilla.com>
Mon, 15 May 2017 14:40:10 -0700
changeset 358544 7f3d55afb48e0c00ec7a9c7d15b5dca290f57b50
parent 358543 f7d5aedd57e442dd287f9893f959f400bb3a5b42
child 358545 a3309e99de1573ef7e7cddbf9c0bcc23721e62ca
push id90352
push usercbook@mozilla.com
push dateTue, 16 May 2017 13:09:14 +0000
treeherdermozilla-inbound@8f89d291e303 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattw
bugs1360796
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1360796 fix intermittent assert, r=mattw MozReview-Commit-ID: IEQeZ6NwVsz
browser/components/extensions/test/browser/browser_ext_tabs_executeScript_bad.js
--- a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_bad.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_bad.js
@@ -147,16 +147,19 @@ add_task(async function testMatchDataURI
     files: {
       "page.html": `<!DOCTYPE html>
         <meta charset="utf-8">
         <script src="page.js"></script>
         <iframe id="inherited" src="data:text/html;charset=utf-8,inherited"></iframe>
       `,
       "page.js": function() {
         browser.test.onMessage.addListener((msg, url) => {
+          if (msg !== "navigate") {
+            return;
+          }
           window.location.href = url;
         });
       },
     },
     background() {
       browser.tabs.create({active: true, url: browser.runtime.getURL("page.html")});
     },
   });
@@ -169,17 +172,20 @@ add_task(async function testMatchDataURI
       browser.webNavigation.onCompleted.addListener(({url, frameId}) => {
         browser.test.log(`Document loading complete: ${url}`);
         if (frameId === 0) {
           browser.test.sendMessage("tab-ready", url);
         }
       });
 
       browser.test.onMessage.addListener(async msg => {
-        browser.test.assertRejects(
+        if (msg !== "execute") {
+          return;
+        }
+        await browser.test.assertRejects(
           browser.tabs.executeScript({
             code: "location.href;",
             allFrames: true,
           }),
           /Missing host permission/,
           "Should not execute in `data:` frame");
 
         browser.test.sendMessage("done");