browser/devtools/webconsole/test/browser_webconsole_bug_837351_securityerrors.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 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/publicdomain/zero/1.0/ */
     4 const TEST_URI = "https://example.com/browser/browser/devtools/webconsole/test/test-bug-837351-security-errors.html";
     6 function run_test()
     7 {
     8   addTab(TEST_URI);
     9   browser.addEventListener("load", function onLoad(aEvent) {
    10     browser.removeEventListener(aEvent.type, onLoad, true);
    11     openConsole(null, function testSecurityErrorLogged (hud) {
    12       let button = hud.ui.rootElement.querySelector(".webconsole-filter-button[category=\"security\"]");
    13       ok(button, "Found security button in the web console");
    15       waitForMessages({
    16         webconsole: hud,
    17         messages: [
    18           {
    19             name: "Logged blocking mixed active content",
    20             text: "Blocked loading mixed active content \"http://example.com/\"",
    21             category: CATEGORY_SECURITY,
    22             severity: SEVERITY_ERROR
    23           },
    24         ],
    25       }).then(finishTest);
    26     });
    27   }, true);
    28 }
    30 function test()
    31 {
    32   SpecialPowers.pushPrefEnv({'set': [["security.mixed_content.block_active_content", true]]}, run_test);
    33 }

mercurial