Bug 1267479 - Use ContentTask to avoid using intermittent CPOWs in browser_bug396843.js. r=wchen
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 21 Jul 2016 15:40:04 -0700
changeset 306435 36bd6dc09186346a0e99c638c433f7d438877d8e
parent 306434 388944aa4d97187fd9a28f10f6ad03d35026940c
child 306436 f9ecbe4d60f8cfd3dbb496a494b176e36c570719
push id30484
push usercbook@mozilla.com
push dateMon, 25 Jul 2016 13:51:04 +0000
treeherdermozilla-central@e23f2ec25e96 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswchen
bugs1267479, 396843
milestone50.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 1267479 - Use ContentTask to avoid using intermittent CPOWs in browser_bug396843.js. r=wchen
dom/tests/browser/browser_bug396843.js
--- a/dom/tests/browser/browser_bug396843.js
+++ b/dom/tests/browser/browser_bug396843.js
@@ -262,21 +262,25 @@ function testInDocument(doc, documentID)
     runTestProps();
     runTestUnwrapped();
 }
 
 add_task(function* test1() {
     testInDocument(document, "browser window");
 });
 
-function newTabTest(location) {
-    let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, location);
-    let doc = content.document;
-    testInDocument(doc, location);
-    yield BrowserTestUtils.removeTab(tab);
+function* newTabTest(location) {
+    yield BrowserTestUtils.withNewTab({ gBrowser, url: location },
+        function* (browser) {
+          yield ContentTask.spawn(browser, { location, testInDocument_: testInDocument.toSource() },
+            function* ({ location, testInDocument_ }) {
+              let testInDocument = eval(`(() => (${testInDocument_}))()`);
+              testInDocument(content.document, location);
+            });
+        });
 }
 
 add_task(function* test2() {
     yield newTabTest("about:blank");
 });
 
 add_task(function* test3() {
     yield newTabTest("about:config");