browser/devtools/webconsole/test/browser_webconsole_bug_837351_securityerrors.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_837351_securityerrors.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +const TEST_URI = "https://example.com/browser/browser/devtools/webconsole/test/test-bug-837351-security-errors.html";
     1.8 +
     1.9 +function run_test()
    1.10 +{
    1.11 +  addTab(TEST_URI);
    1.12 +  browser.addEventListener("load", function onLoad(aEvent) {
    1.13 +    browser.removeEventListener(aEvent.type, onLoad, true);
    1.14 +    openConsole(null, function testSecurityErrorLogged (hud) {
    1.15 +      let button = hud.ui.rootElement.querySelector(".webconsole-filter-button[category=\"security\"]");
    1.16 +      ok(button, "Found security button in the web console");
    1.17 +
    1.18 +      waitForMessages({
    1.19 +        webconsole: hud,
    1.20 +        messages: [
    1.21 +          {
    1.22 +            name: "Logged blocking mixed active content",
    1.23 +            text: "Blocked loading mixed active content \"http://example.com/\"",
    1.24 +            category: CATEGORY_SECURITY,
    1.25 +            severity: SEVERITY_ERROR
    1.26 +          },
    1.27 +        ],
    1.28 +      }).then(finishTest);
    1.29 +    });
    1.30 +  }, true);
    1.31 +}
    1.32 +
    1.33 +function test()
    1.34 +{
    1.35 +  SpecialPowers.pushPrefEnv({'set': [["security.mixed_content.block_active_content", true]]}, run_test);
    1.36 +}
    1.37 +

mercurial