Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: asan OR http3 OR http2
- Manifest: devtools/client/webconsole/test/browser/_webconsole.toml
/* Any copyright is dedicated to the Public Domain.
// Tests that a file with an unsupported CSP directive ('reflected-xss filter')
"use strict";
const EXPECTED_RESULT =
"Not supporting directive \u2018reflected-xss\u2019. " +
"Directive and values will be ignored.";
const TEST_FILE =
"test/browser/test_console_csp_ignore_reflected_xss_message.html";
const TEST_URI =
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
await navigateTo(TEST_FILE);
await checkUniqueMessageExists(hud, EXPECTED_RESULT, ".warn");
ok(
true,
`CSP logs displayed in console when using "reflected-xss" directive`
);
info("Reload page and check that the CSP warning is not duplicated");
await reloadBrowser();
await checkUniqueMessageExists(hud, EXPECTED_RESULT, ".warn");
Services.cache2.clear();
});