browser/devtools/webconsole/test/browser_webconsole_bug_614793_jsterm_scroll.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* vim:set ts=2 sw=2 sts=2 et: */
     2 /*
     3  * Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/publicdomain/zero/1.0/
     5  *
     6  * Contributor(s):
     7  *   Mihai Șucan <mihai.sucan@gmail.com>
     8  */
    10 function consoleOpened(hud) {
    11   hud.jsterm.clearOutput();
    13   let scrollNode = hud.outputNode.parentNode;
    15   for (let i = 0; i < 150; i++) {
    16     content.console.log("test message " + i);
    17   }
    19   let oldScrollTop = -1;
    21   waitForMessages({
    22     webconsole: hud,
    23     messages: [{
    24       text: "test message 149",
    25       category: CATEGORY_WEBDEV,
    26       severity: SEVERITY_LOG,
    27     }],
    28   }).then(() => {
    29     oldScrollTop = scrollNode.scrollTop;
    30     isnot(oldScrollTop, 0, "scroll location is not at the top");
    32     hud.jsterm.execute("'hello world'", onExecute);
    33   });
    35   function onExecute(msg)
    36   {
    37     isnot(scrollNode.scrollTop, oldScrollTop, "scroll location updated");
    39     oldScrollTop = scrollNode.scrollTop;
    41     msg.scrollIntoView(false);
    43     is(scrollNode.scrollTop, oldScrollTop, "scroll location is the same");
    45     finishTest();
    46   }
    47 }
    49 function test() {
    50   addTab("data:text/html;charset=utf-8,Web Console test for bug 614793: jsterm result scroll");
    51   browser.addEventListener("load", function onLoad(aEvent) {
    52     browser.removeEventListener(aEvent.type, onLoad, true);
    53     openConsole(null, consoleOpened);
    54   }, true);
    55 }

mercurial