Skip to content

Commit

Permalink
Bug 1723496: Update tests within caps/ to work with https-first enabl…
Browse files Browse the repository at this point in the history
…ed r=nika

Differential Revision: https://phabricator.services.mozilla.com/D121529
  • Loading branch information
Christoph Kerschbaumer committed Aug 12, 2021
1 parent 663dd64 commit 55f1807
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions caps/tests/mochitest/browser_checkloaduri.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ function testURL(
}

add_task(async function() {
// In this test we want to verify both http and https load
// restrictions, hence we explicitly switch off the https-first
// upgrading mechanism.
await SpecialPowers.pushPrefEnv({
set: [["dom.security.https_first", false]],
});

await kAboutPagesRegistered;
let baseFlags = ssm.STANDARD | ssm.DONT_REPORT_ERRORS;
for (let [sourceString, targetsAndExpectations] of URLs) {
Expand Down
4 changes: 4 additions & 0 deletions caps/tests/unit/test_precursor_principal.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ server.registerPathHandler("/client_replace", (request, response) => {
});

add_task(async function sandboxed_precursor() {
// Bug 1725345: Make XPCShellContentUtils.createHttpServer support https
Services.prefs.setBoolPref("dom.security.https_first", false);

let extension = await ExtensionTestUtils.loadExtension({
manifest: {
permissions: ["webRequest", "webRequestBlocking", "<all_urls>"],
Expand Down Expand Up @@ -253,4 +256,5 @@ add_task(async function sandboxed_precursor() {

await page.close();
}
Services.prefs.clearUserPref("dom.security.https_first");
});

0 comments on commit 55f1807

Please sign in to comment.