Bug 1311197 - Remove CPOWs from browser_bug611242.js. r=Gijs, a=test-only
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 10 Oct 2016 16:54:23 -0700
changeset 356468 dbfd89fca407512297dc4140ce383edf73b6b776
parent 356467 71a57bc90cf23e334c6c680c929f5b0c5c836ada
child 356469 6f26a6f2bc8b0d0ff9acf837b6372c62a57e847d
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, test-only
bugs1311197, 611242
milestone51.0a2
Bug 1311197 - Remove CPOWs from browser_bug611242.js. r=Gijs, a=test-only 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");
     });
   });
-}
+});
 // ----------------------------------------------------------------------------