Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 * ***** END LICENSE BLOCK ***** */
8 // Tests that the Web Console CSP messages are displayed
10 const TEST_BAD_POLICY_URI = "https://example.com/browser/browser/devtools/webconsole/test/test_bug_770099_bad_policy_uri.html";
12 let hud = undefined;
14 function test() {
15 addTab("data:text/html;charset=utf8,Web Console CSP bad policy URI test");
16 browser.addEventListener("load", function _onLoad() {
17 browser.removeEventListener("load", _onLoad, true);
18 openConsole(null, loadDocument);
19 }, true);
20 }
22 function loadDocument(theHud) {
23 hud = theHud;
24 hud.jsterm.clearOutput();
25 browser.addEventListener("load", onLoad, true);
26 content.location = TEST_BAD_POLICY_URI;
27 }
29 function onLoad(aEvent) {
30 browser.removeEventListener("load", onLoad, true);
32 waitForMessages({
33 webconsole: hud,
34 messages: [{
35 text: "can't fetch policy",
36 category: CATEGORY_SECURITY,
37 severity: SEVERITY_ERROR,
38 }],
39 }).then(finishTest);
40 }