Bug 1241735 - Convert browser_webconsole_bug_614793_jsterm_scroll to be more e10s friendly;r=linclark

--HG--
extra : commitid : CNTSWtDoW4B
This commit is contained in:
Brian Grinstead 2016-01-22 10:09:39 -08:00
Родитель d9194bf83f
Коммит 331370d102
1 изменённых файлов: 13 добавлений и 25 удалений

Просмотреть файл

@ -2,9 +2,6 @@
/*
* 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";
@ -12,44 +9,40 @@
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++) {
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);
});
let msg = yield hud.jsterm.execute("'hello world'");
function onExecute(msg) {
isnot(scrollNode.scrollTop, oldScrollTop, "scroll location updated");
oldScrollTop = scrollNode.scrollTop;
@ -57,9 +50,4 @@ function consoleOpened(hud) {
msg.scrollIntoView(false);
is(scrollNode.scrollTop, oldScrollTop, "scroll location is the same");
deferred.resolve();
}
return deferred.promise;
}