Bug 1492482 - Remove CPOW usage from browser_aboutnewtab_process_selection.js. r=Felipe
authorMike Conley <mconley@mozilla.com>
Tue, 02 Oct 2018 18:02:11 +0000
changeset 487608 fe01cfeef13a91090c59e58bc33d1c62c19f0074
parent 487607 16d572f93a940aedfb2eac5cbff73268ac0a4990
child 487609 ae79eeefe39d542fe1321560ec852b58bf37c3f1
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersFelipe
bugs1492482
milestone64.0a1
Bug 1492482 - Remove CPOW usage from browser_aboutnewtab_process_selection.js. r=Felipe Depends on D6967 Differential Revision: https://phabricator.services.mozilla.com/D6968
dom/base/test/browser_aboutnewtab_process_selection.js
--- a/dom/base/test/browser_aboutnewtab_process_selection.js
+++ b/dom/base/test/browser_aboutnewtab_process_selection.js
@@ -13,19 +13,20 @@ add_task(async function(){
   ]});
 });
 
 // Ensure that the preloaded browser exists, and it's finished loading.
 async function ensurePreloaded(gBrowser) {
   gBrowser._createPreloadBrowser();
   // We cannot use the regular BrowserTestUtils helper for waiting here, since that
   // would try to insert the preloaded browser, which would only break things.
-  await BrowserTestUtils.waitForCondition( () => {
-    let doc = gBrowser._preloadedBrowser.contentDocumentAsCPOW;
-    return doc && doc.readyState == "complete";
+  await ContentTask.spawn(gBrowser._preloadedBrowser, null, async () => {
+    await ContentTaskUtils.waitForCondition(() => {
+      return content.document && content.document.readyState == "complete";
+    });
   });
 }
 
 add_task(async function(){
   // This test is only relevant in e10s.
   if (!gMultiProcessBrowser)
     return;