browser/devtools/webconsole/test/browser_webconsole_bug_837351_securityerrors.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial