browser/devtools/webconsole/test/browser_webconsole_bug_601177_log_levels.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-601177-log-levels.html";
    13 function test()
    14 {
    15   //requestLongerTimeout(20);
    16   //FIXME
    17   Services.prefs.setBoolPref("javascript.options.strict", true);
    18   registerCleanupFunction(function() {
    19     Services.prefs.clearUserPref("javascript.options.strict");
    20   });
    22   addTab("data:text/html;charset=utf-8,Web Console test for bug 601177: log levels");
    24   browser.addEventListener("load", function onLoad() {
    25     browser.removeEventListener("load", onLoad, true);
    26     openConsole(null, consoleOpened);
    27   }, true);
    29   function consoleOpened(hud)
    30   {
    31     expectUncaughtException();
    32     content.location = TEST_URI;
    34     info("waiting for messages");
    36     waitForMessages({
    37       webconsole: hud,
    38       messages: [
    39         {
    40           text: "test-bug-601177-log-levels.html",
    41           category: CATEGORY_NETWORK,
    42           severity: SEVERITY_LOG,
    43         },
    44         {
    45           text: "test-bug-601177-log-levels.js",
    46           category: CATEGORY_NETWORK,
    47           severity: SEVERITY_LOG,
    48         },
    49         {
    50           text: "test-image.png",
    51           category: CATEGORY_NETWORK,
    52           severity: SEVERITY_LOG,
    53         },
    54         {
    55           text: "foobar-known-to-fail.png",
    56           category: CATEGORY_NETWORK,
    57           severity: SEVERITY_ERROR,
    58         },
    59         {
    60           text: "foobarBug601177exception",
    61           category: CATEGORY_JS,
    62           severity: SEVERITY_ERROR,
    63         },
    64         {
    65           text: "undefinedPropertyBug601177",
    66           category: CATEGORY_JS,
    67           severity: SEVERITY_WARNING,
    68         },
    69         {
    70           text: "foobarBug601177strictError",
    71           category: CATEGORY_JS,
    72           severity: SEVERITY_WARNING,
    73         },
    74       ],
    75     }).then(finishTest);
    76   }
    77 }

mercurial