Bug 1242716 - Get rid of CPOW usage in browser_webconsole_bug_585237_line_limit.js;r=linclark draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Mon, 25 Jan 2016 13:34:42 -0800
changeset 325557 d0bff47addd06c50a4e1c5ab0e011482d0c09c6d
parent 325556 1bd84f34814d56257b6fed68cf987a0a9291ddcb
child 513466 eca664d726b48aee9ca2c3137331f605ed1a2d60
push id9997
push userbgrinstead@mozilla.com
push dateMon, 25 Jan 2016 21:35:29 +0000
reviewerslinclark
bugs1242716
milestone46.0a1
Bug 1242716 - Get rid of CPOW usage in browser_webconsole_bug_585237_line_limit.js;r=linclark
devtools/client/webconsole/test/browser_webconsole_bug_585237_line_limit.js
--- a/devtools/client/webconsole/test/browser_webconsole_bug_585237_line_limit.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_585237_line_limit.js
@@ -13,59 +13,64 @@ const TEST_URI = "data:text/html;charset
 
 var outputNode;
 
 add_task(function* () {
   yield loadTab(TEST_URI);
 
   let hud = yield openConsole();
 
-  let console = content.console;
   outputNode = hud.outputNode;
 
   hud.jsterm.clearOutput();
 
   let prefBranch = Services.prefs.getBranch("devtools.hud.loglimit.");
   prefBranch.setIntPref("console", 20);
 
   for (let i = 0; i < 30; i++) {
-    // must change message to prevent repeats
-    console.log("foo #" + i);
+    yield ContentTask.spawn(gBrowser.selectedBrowser, i, function(i) {
+      // must change message to prevent repeats
+      content.console.log("foo #" + i);
+    });
   }
 
   yield waitForMessages({
     webconsole: hud,
     messages: [{
       text: "foo #29",
       category: CATEGORY_WEBDEV,
       severity: SEVERITY_LOG,
     }],
   });
 
   is(countMessageNodes(), 20, "there are 20 message nodes in the output " +
      "when the log limit is set to 20");
 
-  console.log("bar bug585237");
+  yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
+    content.console.log("bar bug585237");
+  });
 
   yield waitForMessages({
     webconsole: hud,
     messages: [{
       text: "bar bug585237",
       category: CATEGORY_WEBDEV,
       severity: SEVERITY_LOG,
     }],
   });
 
   is(countMessageNodes(), 20, "there are still 20 message nodes in the " +
      "output when adding one more");
 
   prefBranch.setIntPref("console", 30);
   for (let i = 0; i < 20; i++) {
-    // must change message to prevent repeats
-    console.log("boo #" + i);
+    yield ContentTask.spawn(gBrowser.selectedBrowser, i, function(i) {
+      // must change message to prevent repeats
+      content.console.log("boo #" + i);
+    });
   }
 
   yield waitForMessages({
     webconsole: hud,
     messages: [{
       text: "boo #19",
       category: CATEGORY_WEBDEV,
       severity: SEVERITY_LOG,