Bug 1722978: Update tests within docshell/ to work with https-first enabled r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D121233
This commit is contained in:
Christoph Kerschbaumer 2021-08-02 06:43:27 +00:00
parent b8e361507f
commit 7b1de5e29d
6 changed files with 10 additions and 8 deletions

View File

@ -4,7 +4,7 @@
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
"http://example.com"
"https://example.com"
);
const TEST_URI = `view-source:${TEST_PATH}dummy_page.html`;

View File

@ -4,7 +4,7 @@
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
"http://example.com"
"https://example.com"
);
const MULTIPART_URI = `${TEST_PATH}file_basic_multipart.sjs`;

View File

@ -11,7 +11,7 @@ SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
var workingURL = "http://mochi.test:8888/tests/docshell/test/mochitest/bug529119-window.html";
var faultyURL = "http://www.some-nonexistent-domain-27489274c892748217cn2384.com/";
var faultyURL = "https://www.some-nonexistent-domain-27489274c892748217cn2384.com/";
var w = null;
var phase = 0;

View File

@ -51,7 +51,7 @@ async function runTests(resourcePath) {
let iframe = doc.createElement("iframe");
iframe.id = id;
iframe.name = id;
iframe.src = `http://${host}${resourcePath}file_content_javascript_loads_frame.html`;
iframe.src = `https://${host}${resourcePath}file_content_javascript_loads_frame.html`;
doc.body.appendChild(iframe);
return promiseEvent(iframe, "load");
}
@ -149,7 +149,7 @@ add_task(async function() {
const resourcePath = location.pathname.replace(/[^\/]+$/, "");
let win = window.open(
`http://example.com${resourcePath}file_content_javascript_loads_root.html`
`https://example.com${resourcePath}file_content_javascript_loads_root.html`
);
await promiseMessage(win, event => event.data == "ready");

View File

@ -5,7 +5,7 @@
<link rel="stylesheet" href="/tests/SimpleTest/test.css" />
</head>
<script>
// Open a window and navigate it from http://example.net to about:blank
// Open a window and navigate it from https://example.com to about:blank
// With fission, we should switch processes and about:blank should load in
// the same process as this test page.
// This is a crash test.
@ -20,7 +20,7 @@ add_task(async function test_aboutblank_change_process() {
window.addEventListener("message", onMessage);
});
let win = window.open();
win.location = "http://example.net/tests/docshell/test/navigation/file_tell_opener.html";
win.location = "https://example.com/tests/docshell/test/navigation/file_tell_opener.html";
await exampleLoaded;
win.location = "about:blank";
@ -33,7 +33,7 @@ add_task(async function test_aboutblank_change_process() {
try {
return win.location.href == "about:blank";
} catch (e) {
// While the `win` still has example.net page loaded, `win.location` will
// While the `win` still has example.com page loaded, `win.location` will
// be a cross origin object and querying win.location.href will throw a
// SecurityError. Return false as long as this is the case.
return false;

View File

@ -65,6 +65,7 @@ function createSubframe(bc, url) {
}
add_task(async function() {
Services.prefs.setBoolPref("dom.security.https_first", false);
ChromeUtils.registerWindowActor(ACTOR, {
allFrames: true,
child: {
@ -268,4 +269,5 @@ add_task(async function() {
await assertScriptsAllowed(bc, false, "top BC with scripts disabled");
await page.close();
Services.prefs.clearUserPref("dom.security.https_first");
});