browser/devtools/webconsole/test/browser_webconsole_console_extras.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* vim:set ts=2 sw=2 sts=2 et: */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 // Test that window.console functions that are not implemented yet do not
     7 // output anything in the web console and they do not throw any exceptions.
     8 // See bug 614350.
    10 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-extras.html";
    12 function test() {
    13   addTab(TEST_URI);
    14   browser.addEventListener("load", function onLoad() {
    15     browser.removeEventListener("load", onLoad, true);
    16     openConsole(null, consoleOpened);
    17   }, true);
    18 }
    20 function consoleOpened(hud) {
    21   waitForMessages({
    22     webconsole: hud,
    23     messages: [{
    24       text: "start",
    25       category: CATEGORY_WEBDEV,
    26       severity: SEVERITY_LOG,
    27     },
    28     {
    29       text: "end",
    30       category: CATEGORY_WEBDEV,
    31       severity: SEVERITY_LOG,
    32     }],
    33   }).then(() => {
    34     let nodes = hud.outputNode.querySelectorAll(".message");
    35     is(nodes.length, 2, "only two messages are displayed");
    36     finishTest();
    37   });
    39   let button = content.document.querySelector("button");
    40   ok(button, "we have the button");
    41   EventUtils.sendMouseEvent({ type: "click" }, button, content);
    42 }

mercurial