browser_mixedContentFramesOnHttp.js (1190B)
1 /* 2 * Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 * 5 * Test for Bug 1182551 - 6 * 7 * This test has a top level HTTP page with an HTTPS iframe. The HTTPS iframe 8 * includes an HTTP image. We check that the top level security state is 9 * STATE_IS_INSECURE. The mixed content from the iframe shouldn't "upgrade" 10 * the HTTP top level page to broken HTTPS. 11 */ 12 13 const TEST_URL = 14 getRootDirectory(gTestPath).replace( 15 "chrome://mochitests/content", 16 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 17 "http://example.com" 18 ) + "file_mixedContentFramesOnHttp.html"; 19 20 add_task(async function () { 21 await SpecialPowers.pushPrefEnv({ 22 set: [ 23 ["security.mixed_content.block_active_content", true], 24 ["security.mixed_content.block_display_content", false], 25 ["security.mixed_content.upgrade_display_content", false], 26 ], 27 }); 28 29 await BrowserTestUtils.withNewTab(TEST_URL, async function (browser) { 30 isSecurityState(browser, "insecure"); 31 await assertMixedContentBlockingState(browser, { 32 activeLoaded: false, 33 activeBlocked: false, 34 passiveLoaded: true, 35 }); 36 }); 37 });