2 * Description of the test:
3 * Check that mixed content blocker works prevents fetches of
4 * mixed content manifests.
8 const { ManifestObtainer } = ChromeUtils.importESModule(
9 "resource://gre/modules/ManifestObtainer.sys.mjs"
11 const path = "/tests/dom/security/test/csp/";
12 const mixedContent = `${path}file_web_manifest_mixed_content.html`;
13 const server = `${path}file_testserver.sjs`;
14 const secureURL = new URL(`https://example.com${server}`);
16 // Trying to load mixed content in file_web_manifest_mixed_content.html
17 // needs to result in an error.
19 expected: "Mixed Content Blocker prevents fetching manifest.",
21 const url = new URL(secureURL);
22 url.searchParams.append("file", mixedContent);
26 // Check reason for error.
27 const check = /NetworkError when attempting to fetch resource/.test(
30 ok(check, this.expected);
36 add_task(async function () {
38 const testPromises = tests.map(test => {
44 return BrowserTestUtils.withNewTab(tabOptions, browser =>
45 testObtainingManifest(browser, test)
48 await Promise.all(testPromises);
51 async function testObtainingManifest(aBrowser, aTest) {
53 await ManifestObtainer.browserObtainManifest(aBrowser);