Bug 1716500: Update test browser_HSTS.js to work with https-first enabled in PBM r=bbeurdouche

Differential Revision: https://phabricator.services.mozilla.com/D117736
This commit is contained in:
Christoph Kerschbaumer 2021-06-15 08:30:42 +00:00
Родитель 34fb5ef4cf
Коммит 543135c5fd
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -68,6 +68,9 @@ add_task(async function test_unrelated_domain_no_upgrade() {
// http navigations in private contexts shouldn't use information from
// non-private contexts, so no upgrade should occur.
add_task(async function test_private_window_no_upgrade() {
await SpecialPowers.pushPrefEnv({
set: [["dom.security.https_first_pbm", false]],
});
let privateWindow = OpenBrowserWindow({ private: true });
await BrowserTestUtils.firstBrowserLoaded(privateWindow, false);
let url =
@ -244,6 +247,9 @@ add_task(async function clear_hsts_state_again() {
// non-private contexts.
add_task(
async function test_no_upgrade_for_HSTS_information_from_private_window() {
await SpecialPowers.pushPrefEnv({
set: [["dom.security.https_first_pbm", false]],
});
let privateWindow = OpenBrowserWindow({ private: true });
await BrowserTestUtils.firstBrowserLoaded(privateWindow, false);
let setHstsUrl =