browser/devtools/webconsole/test/browser_webconsole_bug_601177_log_levels.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_601177_log_levels.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,77 @@
     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-601177-log-levels.html";
    1.15 +
    1.16 +function test()
    1.17 +{
    1.18 +  //requestLongerTimeout(20);
    1.19 +  //FIXME
    1.20 +  Services.prefs.setBoolPref("javascript.options.strict", true);
    1.21 +  registerCleanupFunction(function() {
    1.22 +    Services.prefs.clearUserPref("javascript.options.strict");
    1.23 +  });
    1.24 +
    1.25 +  addTab("data:text/html;charset=utf-8,Web Console test for bug 601177: log levels");
    1.26 +
    1.27 +  browser.addEventListener("load", function onLoad() {
    1.28 +    browser.removeEventListener("load", onLoad, true);
    1.29 +    openConsole(null, consoleOpened);
    1.30 +  }, true);
    1.31 +
    1.32 +  function consoleOpened(hud)
    1.33 +  {
    1.34 +    expectUncaughtException();
    1.35 +    content.location = TEST_URI;
    1.36 +
    1.37 +    info("waiting for messages");
    1.38 +
    1.39 +    waitForMessages({
    1.40 +      webconsole: hud,
    1.41 +      messages: [
    1.42 +        {
    1.43 +          text: "test-bug-601177-log-levels.html",
    1.44 +          category: CATEGORY_NETWORK,
    1.45 +          severity: SEVERITY_LOG,
    1.46 +        },
    1.47 +        {
    1.48 +          text: "test-bug-601177-log-levels.js",
    1.49 +          category: CATEGORY_NETWORK,
    1.50 +          severity: SEVERITY_LOG,
    1.51 +        },
    1.52 +        {
    1.53 +          text: "test-image.png",
    1.54 +          category: CATEGORY_NETWORK,
    1.55 +          severity: SEVERITY_LOG,
    1.56 +        },
    1.57 +        {
    1.58 +          text: "foobar-known-to-fail.png",
    1.59 +          category: CATEGORY_NETWORK,
    1.60 +          severity: SEVERITY_ERROR,
    1.61 +        },
    1.62 +        {
    1.63 +          text: "foobarBug601177exception",
    1.64 +          category: CATEGORY_JS,
    1.65 +          severity: SEVERITY_ERROR,
    1.66 +        },
    1.67 +        {
    1.68 +          text: "undefinedPropertyBug601177",
    1.69 +          category: CATEGORY_JS,
    1.70 +          severity: SEVERITY_WARNING,
    1.71 +        },
    1.72 +        {
    1.73 +          text: "foobarBug601177strictError",
    1.74 +          category: CATEGORY_JS,
    1.75 +          severity: SEVERITY_WARNING,
    1.76 +        },
    1.77 +      ],
    1.78 +    }).then(finishTest);
    1.79 +  }
    1.80 +}

mercurial