Bug 1256812 - Fix ESLint issues in devtools/client/webconsole/test/browser_warn_user_about_replaced_api.js. r=bgrins, a=test-only
authormoby <mvonbriesen@mozilla.com>
Wed, 25 May 2016 14:42:00 -0400
changeset 333067 21a7e88e2cc80ba9b6325ebcd7481548554c76e7
parent 333066 da19ad7ec3e1362dedadcaa2490939d14a214384
child 333068 6fed4247ab98d682083cef66b03df65fff41a47c
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins, test-only
bugs1256812
milestone48.0a2
Bug 1256812 - Fix ESLint issues in devtools/client/webconsole/test/browser_warn_user_about_replaced_api.js. r=bgrins, a=test-only
devtools/client/webconsole/test/browser_warn_user_about_replaced_api.js
--- a/devtools/client/webconsole/test/browser_warn_user_about_replaced_api.js
+++ b/devtools/client/webconsole/test/browser_warn_user_about_replaced_api.js
@@ -15,17 +15,17 @@ add_task(function* () {
   Services.prefs.setBoolPref(PREF, true);
 
   let { browser } = yield loadTab(TEST_URI);
   let hud = yield openConsole();
 
   yield testWarningNotPresent(hud);
 
   let loaded = loadBrowser(browser);
-  content.location = TEST_REPLACED_API_URI;
+  BrowserTestUtils.loadURI(browser, TEST_REPLACED_API_URI);
   yield loaded;
 
   let hud2 = yield openConsole();
 
   yield testWarningPresent(hud2);
 
   Services.prefs.clearUserPref(PREF);
 });
@@ -33,17 +33,20 @@ add_task(function* () {
 function testWarningNotPresent(hud) {
   let deferred = promise.defer();
 
   is(hud.outputNode.textContent.indexOf("logging API"), -1,
      "no warning displayed");
 
   // Bug 862024: make sure the warning doesn't show after page reload.
   info("reload " + TEST_URI);
-  executeSoon(() => content.location.reload());
+  executeSoon(function () {
+    let browser = gBrowser.selectedBrowser;
+    ContentTask.spawn(browser, null, "() => content.location.reload()");
+  });
 
   waitForMessages({
     webconsole: hud,
     messages: [{
       text: "testscript.js",
       category: CATEGORY_NETWORK,
     }],
   }).then(() => executeSoon(() => {
@@ -69,14 +72,15 @@ function testWarningPresent(hud) {
   };
 
   waitForMessages(warning).then(() => {
     hud.jsterm.clearOutput();
 
     executeSoon(() => {
       info("reload the test page and wait for the warning to show");
       waitForMessages(warning).then(deferred.resolve);
-      content.location.reload();
+      let browser = gBrowser.selectedBrowser;
+      ContentTask.spawn(browser, null, "() => content.location.reload()");
     });
   });
 
   return deferred.promise;
 }