Bug 1256794 - [ESLint] Fix ESLint issues in devtools/client/webconsole/test/browser_console_private_browsing.js. r=bgrins, a=test-only
authorMichael Kohler <mkohler@picobudget.com>
Sat, 07 May 2016 11:35:00 +0200
changeset 333113 12f9bd2adb0e89754c39d2d5c8688b1bc818775a
parent 333112 35f1e2eeab310bddceae79015b536aee4037ae06
child 333114 9e856f294fa1bd92a5e086a33eedbb33ef782a30
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
bugs1256794
milestone48.0a2
Bug 1256794 - [ESLint] Fix ESLint issues in devtools/client/webconsole/test/browser_console_private_browsing.js. r=bgrins, a=test-only MozReview-Commit-ID: IFqqaYMACke
devtools/client/webconsole/test/browser_console_private_browsing.js
--- a/devtools/client/webconsole/test/browser_console_private_browsing.js
+++ b/devtools/client/webconsole/test/browser_console_private_browsing.js
@@ -33,28 +33,30 @@ function test() {
     gBrowser.selectedBrowser.removeEventListener("load", onLoadTab, true);
     info("onLoadTab()");
 
     // Make sure we have a clean state to start with.
     Services.console.reset();
     ConsoleAPIStorage.clearEvents();
 
     // Add a non-private message to the browser console.
-    content.console.log("bug874061-not-private");
+    ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
+      content.console.log("bug874061-not-private");
+    });
 
     nonPrivateMessage = {
       name: "console message from a non-private window",
       text: "bug874061-not-private",
       category: CATEGORY_WEBDEV,
       severity: SEVERITY_LOG,
     };
 
     privateWindow = OpenBrowserWindow({ private: true });
     ok(privateWindow, "new private window");
-    ok(PrivateBrowsingUtils.isWindowPrivate(privateWindow), "window is private");
+    ok(PrivateBrowsingUtils.isWindowPrivate(privateWindow), "window's private");
 
     whenDelayedStartupFinished(privateWindow, onPrivateWindowReady);
   }
 
   function onPrivateWindowReady() {
     info("private browser window opened");
     privateBrowser = privateWindow.gBrowser;
 
@@ -70,18 +72,18 @@ function test() {
   }
 
   function addMessages() {
     let button = privateContent.document.querySelector("button");
     ok(button, "button in page");
     EventUtils.synthesizeMouse(button, 2, 2, {}, privateContent);
   }
 
-  function consoleOpened(aHud) {
-    hud = aHud;
+  function consoleOpened(injectedHud) {
+    hud = injectedHud;
     ok(hud, "web console opened");
 
     addMessages();
     expectedMessages = [
       {
         name: "script error",
         text: "fooBazBaz is not defined",
         category: CATEGORY_JS,
@@ -106,18 +108,18 @@ function test() {
   function testCachedMessages() {
     info("testCachedMessages()");
     closeConsole(privateTab).then(() => {
       info("web console closed");
       openConsole(privateTab).then(consoleReopened);
     });
   }
 
-  function consoleReopened(aHud) {
-    hud = aHud;
+  function consoleReopened(injectedHud) {
+    hud = injectedHud;
     ok(hud, "web console reopened");
 
     // Make sure that cached messages are displayed in the web console, even
     // if this is a private tab.
     waitForMessages({
       webconsole: hud,
       messages: expectedMessages,
     }).then(testBrowserConsole);
@@ -134,51 +136,51 @@ function test() {
   // Make sure that the cached messages from private tabs are not displayed in
   // the browser console.
   function checkNoPrivateMessages() {
     let text = hud.outputNode.textContent;
     is(text.indexOf("fooBazBaz"), -1, "no exception displayed");
     is(text.indexOf("bug 874061"), -1, "no console message displayed");
   }
 
-  function onBrowserConsoleOpen(aHud) {
-    hud = aHud;
+  function onBrowserConsoleOpen(injectedHud) {
+    hud = injectedHud;
     ok(hud, "browser console opened");
 
     checkNoPrivateMessages();
     addMessages();
     expectedMessages.push(nonPrivateMessage);
 
     // Make sure that live messages are displayed in the browser console, even
     // from private tabs.
     waitForMessages({
       webconsole: hud,
       messages: expectedMessages,
     }).then(testPrivateWindowClose);
   }
 
   function testPrivateWindowClose() {
-    info("close the private window and check if the private messages are removed");
+    info("close the private window and check if private messages are removed");
     hud.jsterm.once("private-messages-cleared", () => {
       isnot(hud.outputNode.textContent.indexOf("bug874061-not-private"), -1,
             "non-private messages are still shown after private window closed");
       checkNoPrivateMessages();
 
       info("close the browser console");
       HUDService.toggleBrowserConsole().then(() => {
         info("reopen the browser console");
         executeSoon(() =>
           HUDService.toggleBrowserConsole().then(onBrowserConsoleReopen));
       });
     });
     privateWindow.BrowserTryToCloseWindow();
   }
 
-  function onBrowserConsoleReopen(aHud) {
-    hud = aHud;
+  function onBrowserConsoleReopen(injectedHud) {
+    hud = injectedHud;
     ok(hud, "browser console reopened");
 
     // Make sure that the non-private message is still shown after reopen.
     waitForMessages({
       webconsole: hud,
       messages: [nonPrivateMessage],
     }).then(() => {
       // Make sure that no private message is displayed after closing the