browser/devtools/webconsole/test/browser_webconsole_bug_603750_websocket.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 /* ***** BEGIN LICENSE BLOCK *****
     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  *
     9  * ***** END LICENSE BLOCK ***** */
    11 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug-603750-websocket.html";
    13 function test() {
    14   addTab("data:text/html;charset=utf-8,Web Console test for bug 603750: Web Socket errors");
    15   browser.addEventListener("load", function tabLoad() {
    16     browser.removeEventListener("load", tabLoad, true);
    17     openConsole(null, (hud) => {
    18       content.location = TEST_URI;
    19       info("waiting for websocket errors");
    20       waitForMessages({
    21         webconsole: hud,
    22         messages: [
    23           {
    24             text: "ws://0.0.0.0:81",
    25             source: { url: "test-bug-603750-websocket.js" },
    26             category: CATEGORY_JS,
    27             severity: SEVERITY_ERROR,
    28           },
    29           {
    30             text: "ws://0.0.0.0:82",
    31             source: { url: "test-bug-603750-websocket.js" },
    32             category: CATEGORY_JS,
    33             severity: SEVERITY_ERROR,
    34           },
    35         ]}).then(finishTest);
    36     });
    37   }, true);
    38 }

mercurial