зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1560178
- adjust webextension tests that rely on loading untrusted URIs in the parent process when remote webextensions are turned off, r=aswan
Differential Revision: https://phabricator.services.mozilla.com/D36309 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0bd423ac63
Коммит
2a0b208604
|
@ -54,6 +54,12 @@ add_task(async function testPageActionPopup() {
|
|||
});
|
||||
});
|
||||
|
||||
if (!Services.prefs.getBoolPref("extensions.webextensions.remote", true)) {
|
||||
SpecialPowers.pushPrefEnv({
|
||||
set: [["security.allow_unsafe_parent_loads", true]],
|
||||
});
|
||||
}
|
||||
|
||||
await extension.startup();
|
||||
await extension.awaitMessage("ready");
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@ function createHiddenBrowser(url) {
|
|||
let doc = subframe.document;
|
||||
let browser = doc.createElementNS(XUL_NS, "browser");
|
||||
browser.setAttribute("type", "content");
|
||||
if (Services.appinfo.browserTabsRemoteAutostart) {
|
||||
browser.setAttribute("remote", "true");
|
||||
}
|
||||
browser.setAttribute("disableglobalhistory", "true");
|
||||
browser.setAttribute("src", url);
|
||||
|
||||
|
|
|
@ -227,6 +227,10 @@ add_task(async function test_webext_background_remote_subframe_privileges() {
|
|||
"background-subframe.js": backgroundSubframeScript,
|
||||
},
|
||||
};
|
||||
// Need remote webextensions to be able to load remote content from a background page.
|
||||
if (!SpecialPowers.getBoolPref("extensions.webextensions.remote", true)) {
|
||||
return;
|
||||
}
|
||||
let extension = ExtensionTestUtils.loadExtension(extensionData);
|
||||
|
||||
await extension.startup();
|
||||
|
|
|
@ -106,6 +106,11 @@ add_task(async function test_WebExtensinonContentScript_frame_matching() {
|
|||
// infra.
|
||||
return;
|
||||
}
|
||||
Services.prefs.setBoolPref(
|
||||
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer",
|
||||
true
|
||||
);
|
||||
Services.prefs.setBoolPref("security.allow_unsafe_parent_loads", true);
|
||||
|
||||
let baseURL = `http://localhost:${server.identity.primaryPort}/data`;
|
||||
let urls = {
|
||||
|
|
|
@ -139,6 +139,11 @@ add_task(async function test_parent_to_child() {
|
|||
|
||||
await extension.awaitMessage("bg-ready");
|
||||
|
||||
Services.prefs.setBoolPref(
|
||||
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer",
|
||||
true
|
||||
);
|
||||
Services.prefs.setBoolPref("security.allow_unsafe_parent_loads", true);
|
||||
let contentPage = await ExtensionTestUtils.loadContentPage(
|
||||
`${BASE_URL}/file_sample.html`
|
||||
);
|
||||
|
|
|
@ -660,6 +660,11 @@ add_task(async function test_connect_native_from_content_script() {
|
|||
|
||||
await extension.startup();
|
||||
|
||||
Services.prefs.setBoolPref(
|
||||
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer",
|
||||
true
|
||||
);
|
||||
Services.prefs.setBoolPref("security.allow_unsafe_parent_loads", true);
|
||||
await ExtensionTestUtils.loadContentPage("http://example.com/dummy");
|
||||
|
||||
let result = await extension.awaitMessage("result");
|
||||
|
|
Загрузка…
Ссылка в новой задаче