michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const TEST_URI = "https://example.com/browser/browser/devtools/webconsole/test/test-bug-837351-security-errors.html"; michael@0: michael@0: function run_test() michael@0: { michael@0: addTab(TEST_URI); michael@0: browser.addEventListener("load", function onLoad(aEvent) { michael@0: browser.removeEventListener(aEvent.type, onLoad, true); michael@0: openConsole(null, function testSecurityErrorLogged (hud) { michael@0: let button = hud.ui.rootElement.querySelector(".webconsole-filter-button[category=\"security\"]"); michael@0: ok(button, "Found security button in the web console"); michael@0: michael@0: waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [ michael@0: { michael@0: name: "Logged blocking mixed active content", michael@0: text: "Blocked loading mixed active content \"http://example.com/\"", michael@0: category: CATEGORY_SECURITY, michael@0: severity: SEVERITY_ERROR michael@0: }, michael@0: ], michael@0: }).then(finishTest); michael@0: }); michael@0: }, true); michael@0: } michael@0: michael@0: function test() michael@0: { michael@0: SpecialPowers.pushPrefEnv({'set': [["security.mixed_content.block_active_content", true]]}, run_test); michael@0: } michael@0: