Bug 1311197 - Remove CPOWs from browser_bug611242.js. r=Gijs
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 10 Oct 2016 16:54:23 -0700
changeset 321440 9ce4a72010fa5012941c19d91138659e24864470
parent 321439 276b093c968ffc889f465161b7aa1fe80c796988
child 321441 fbd597046674eae52e0dcfefb725070794682858
push id83603
push usermrbkap@mozilla.com
push dateMon, 07 Nov 2016 22:44:42 +0000
treeherdermozilla-inbound@8e998fdc243d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1311197, 611242
milestone52.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 1311197 - Remove CPOWs from browser_bug611242.js. r=Gijs MozReview-Commit-ID: Inunje5BaMJ
toolkit/mozapps/extensions/test/xpinstall/browser_bug611242.js
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_bug611242.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_bug611242.js
@@ -1,26 +1,17 @@
 // ----------------------------------------------------------------------------
 // Test whether setting a new property in InstallTrigger then persists to other
 // page loads
-function loadURI(aUri, aCallback) {
-  BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, aUri).then(aCallback);
-  gBrowser.loadURI(aUri);
-}
-
-function test() {
-  waitForExplicitFinish();
-
-  gBrowser.selectedTab = gBrowser.addTab();
+add_task(function* test() {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: TESTROOT + "enabled.html" }, function* (browser) {
+    yield ContentTask.spawn(browser, null, () => {
+      content.wrappedJSObject.InstallTrigger.enabled.k = function() { };
+    });
 
-  loadURI(TESTROOT + "enabled.html", function() {
-    window.content.wrappedJSObject.InstallTrigger.enabled.k = function() { };
-
-    loadURI(TESTROOT2 + "enabled.html", function() {
-      is(window.content.wrappedJSObject.InstallTrigger.enabled.k, undefined, "Property should not be defined");
-
-      gBrowser.removeTab(gBrowser.selectedTab);
-
-      finish();
+    BrowserTestUtils.loadURI(browser, TESTROOT2 + "enabled.html");
+    yield BrowserTestUtils.browserLoaded(browser);
+    yield ContentTask.spawn(browser, null, () => {
+      is(content.wrappedJSObject.InstallTrigger.enabled.k, undefined, "Property should not be defined");
     });
   });
-}
+});
 // ----------------------------------------------------------------------------