Bug 1241735 - Convert browser_webconsole_bug_614793_jsterm_scroll to be more e10s friendly;r=linclark
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 22 Jan 2016 10:09:39 -0800
changeset 281364 3276faa4c6a4b410365500f27233e9cc9e4a8ad6
parent 281363 c77c13e5730fa2230ba19bb81a4dca8a10f0a53e
child 281365 ef1a8059393e2280464407a498ddf14baab372cf
push id29935
push userphilringnalda@gmail.com
push dateSun, 24 Jan 2016 02:12:02 +0000
treeherdermozilla-central@a2e81822194a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslinclark
bugs1241735
milestone46.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 1241735 - Convert browser_webconsole_bug_614793_jsterm_scroll to be more e10s friendly;r=linclark
devtools/client/webconsole/test/browser_webconsole_bug_614793_jsterm_scroll.js
--- a/devtools/client/webconsole/test/browser_webconsole_bug_614793_jsterm_scroll.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_614793_jsterm_scroll.js
@@ -1,65 +1,53 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /*
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
- *
- * Contributor(s):
- *   Mihai Șucan <mihai.sucan@gmail.com>
  */
 
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf-8,Web Console test for " +
                  "bug 614793: jsterm result scroll";
 
-"use strict";
-
 add_task(function* () {
   yield loadTab(TEST_URI);
-
   let hud = yield openConsole();
 
-  yield consoleOpened(hud);
+  yield testScrollPosition(hud);
 });
 
-function consoleOpened(hud) {
-  let deferred = promise.defer();
-
+function* testScrollPosition(hud) {
   hud.jsterm.clearOutput();
 
   let scrollNode = hud.ui.outputWrapper;
 
   for (let i = 0; i < 150; i++) {
-    content.console.log("test message " + i);
+    yield ContentTask.spawn(gBrowser.selectedBrowser, i, function*(i) {
+      content.console.log("test message " + i);
+    });
   }
 
   let oldScrollTop = -1;
 
-  waitForMessages({
+  yield waitForMessages({
     webconsole: hud,
     messages: [{
       text: "test message 149",
       category: CATEGORY_WEBDEV,
       severity: SEVERITY_LOG,
     }],
-  }).then(() => {
-    oldScrollTop = scrollNode.scrollTop;
-    isnot(oldScrollTop, 0, "scroll location is not at the top");
-
-    hud.jsterm.execute("'hello world'").then(onExecute);
   });
 
-  function onExecute(msg) {
-    isnot(scrollNode.scrollTop, oldScrollTop, "scroll location updated");
+  oldScrollTop = scrollNode.scrollTop;
+  isnot(oldScrollTop, 0, "scroll location is not at the top");
 
-    oldScrollTop = scrollNode.scrollTop;
+  let msg = yield hud.jsterm.execute("'hello world'");
 
-    msg.scrollIntoView(false);
+  isnot(scrollNode.scrollTop, oldScrollTop, "scroll location updated");
 
-    is(scrollNode.scrollTop, oldScrollTop, "scroll location is the same");
+  oldScrollTop = scrollNode.scrollTop;
 
-    deferred.resolve();
-  }
+  msg.scrollIntoView(false);
 
-  return deferred.promise;
+  is(scrollNode.scrollTop, oldScrollTop, "scroll location is the same");
 }