Bug 1372476 - Add event load listener before start loading in docshell/test/browser/browser_bug349769.js. r=billm
authorTooru Fujisawa <arai_a@mac.com>
Sun, 10 Dec 2017 20:12:11 -0600
changeset 396006 ea64f1bb6c97bfc9437a8841b1d9a2bc54938016
parent 396005 d47afd9b9df22cb39eac5a93e81691e81b2029f5
child 396007 a296cf538ee1df4a8dbf32131d0f55591337f6f1
push id98229
push userarai_a@mac.com
push dateMon, 11 Dec 2017 02:12:40 +0000
treeherdermozilla-inbound@ea64f1bb6c97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1372476, 349769
milestone59.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 1372476 - Add event load listener before start loading in docshell/test/browser/browser_bug349769.js. r=billm
docshell/test/browser/browser_bug349769.js
--- a/docshell/test/browser/browser_bug349769.js
+++ b/docshell/test/browser/browser_bug349769.js
@@ -12,30 +12,31 @@ add_task(async function test() {
                        .getService(Ci.nsIScriptSecurityManager);
       Assert.equal(secMan.isSystemPrincipal(prin), false,
          "Loaded principal must not be system when loading " + uri);
     });
   }
 
   for (var uri of uris) {
     await BrowserTestUtils.withNewTab({ gBrowser }, async function(newBrowser) {
+      let loadedPromise = BrowserTestUtils.browserLoaded(newBrowser);
       await BrowserTestUtils.loadURI(newBrowser, uri);
 
       var prin = newBrowser.contentPrincipal;
       isnot(prin, null, "Forced principal must not be null when loading " + uri);
       isnot(prin, undefined,
             "Forced principal must not be undefined when loading " + uri);
       is(secMan.isSystemPrincipal(prin), false,
          "Forced principal must not be system when loading " + uri);
 
       // Belt-and-suspenders e10s check: make sure that the same checks hold
       // true in the content process.
       await checkContentProcess(newBrowser, uri);
 
-      await BrowserTestUtils.browserLoaded(newBrowser);
+      await loadedPromise;
 
       prin = newBrowser.contentPrincipal;
       isnot(prin, null, "Loaded principal must not be null when adding " + uri);
       isnot(prin, undefined, "Loaded principal must not be undefined when loading " + uri);
       is(secMan.isSystemPrincipal(prin), false,
          "Loaded principal must not be system when loading " + uri);
 
       // Belt-and-suspenders e10s check: make sure that the same checks hold