browser/devtools/webconsole/test/browser_webconsole_bug_603750_websocket.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_603750_websocket.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +/* vim:set ts=2 sw=2 sts=2 et: */
     1.5 +/* ***** BEGIN LICENSE BLOCK *****
     1.6 + * Any copyright is dedicated to the Public Domain.
     1.7 + * http://creativecommons.org/publicdomain/zero/1.0/
     1.8 + *
     1.9 + * Contributor(s):
    1.10 + *  Mihai Șucan <mihai.sucan@gmail.com>
    1.11 + *
    1.12 + * ***** END LICENSE BLOCK ***** */
    1.13 +
    1.14 +const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug-603750-websocket.html";
    1.15 +
    1.16 +function test() {
    1.17 +  addTab("data:text/html;charset=utf-8,Web Console test for bug 603750: Web Socket errors");
    1.18 +  browser.addEventListener("load", function tabLoad() {
    1.19 +    browser.removeEventListener("load", tabLoad, true);
    1.20 +    openConsole(null, (hud) => {
    1.21 +      content.location = TEST_URI;
    1.22 +      info("waiting for websocket errors");
    1.23 +      waitForMessages({
    1.24 +        webconsole: hud,
    1.25 +        messages: [
    1.26 +          {
    1.27 +            text: "ws://0.0.0.0:81",
    1.28 +            source: { url: "test-bug-603750-websocket.js" },
    1.29 +            category: CATEGORY_JS,
    1.30 +            severity: SEVERITY_ERROR,
    1.31 +          },
    1.32 +          {
    1.33 +            text: "ws://0.0.0.0:82",
    1.34 +            source: { url: "test-bug-603750-websocket.js" },
    1.35 +            category: CATEGORY_JS,
    1.36 +            severity: SEVERITY_ERROR,
    1.37 +          },
    1.38 +        ]}).then(finishTest);
    1.39 +    });
    1.40 +  }, true);
    1.41 +}
    1.42 +

mercurial