Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1648545) for causing mass failures
Browse files Browse the repository at this point in the history
Backed out changeset ac3d639547fa (bug 1648545)
Backed out changeset f63760c845f3 (bug 1648545)
Backed out changeset 652b48b10d37 (bug 1648545)
Backed out changeset 1ca7abd873d1 (bug 1648545)
  • Loading branch information
nerli1 committed May 25, 2023
1 parent e56011d commit 06b68d0
Show file tree
Hide file tree
Showing 90 changed files with 322 additions and 478 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ const intermittently_loaded_scripts = {
"resource://testing-common/BrowserTestUtilsChild.sys.mjs",
"resource://testing-common/ContentEventListenerChild.sys.mjs",
"resource://specialpowers/AppTestDelegateChild.sys.mjs",
"resource://testing-common/SpecialPowersChild.sys.mjs",
"resource://testing-common/WrapPrivileged.sys.mjs",
"resource://specialpowers/SpecialPowersChild.sys.mjs",
"resource://specialpowers/WrapPrivileged.sys.mjs",
]),
frameScripts: new Set([]),
processScripts: new Set([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ const intermittently_loaded_scripts = {
"chrome://remote/content/shared/Log.sys.mjs",
"resource://testing-common/BrowserTestUtilsChild.sys.mjs",
"resource://testing-common/ContentEventListenerChild.sys.mjs",
"resource://testing-common/SpecialPowersChild.sys.mjs",
"resource://specialpowers/SpecialPowersChild.sys.mjs",
"resource://specialpowers/AppTestDelegateChild.sys.mjs",
"resource://testing-common/WrapPrivileged.sys.mjs",
"resource://specialpowers/WrapPrivileged.sys.mjs",
]),
processScripts: new Set([]),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ async function synthesizeMouse(browser, link, event) {
browser,
[link, event],
(linkInContent, eventInContent) => {
const { EventUtils } = ChromeUtils.importESModule(
"resource://specialpowers/SpecialPowersEventUtils.sys.mjs"
);
const target = content.document.getElementById(linkInContent);
EventUtils.synthesizeMouseAtCenter(target, eventInContent, content);
return target.href;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ async function clickOn(selector, beforeContentFn) {
}

await SpecialPowers.spawn(lastTab.linkedBrowser, [selector], arg => {
/* eslint-env mozilla/chrome-script */
const { EventUtils } = ChromeUtils.importESModule(
"resource://specialpowers/SpecialPowersEventUtils.sys.mjs"
);

let element = content.document.querySelector(arg);
return EventUtils.synthesizeClick(element);
});
Expand Down
7 changes: 0 additions & 7 deletions devtools/shared/tests/xpcshell/test_fetch-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
const URL_FOUND = "resource://devtools/shared/DevToolsUtils.js";
const URL_NOT_FOUND = "resource://devtools/this/is/not/here.js";

// Disable `xpc::IsInAutomation()` so we don't crash when accessing a
// nonexistent resource URI.
Services.prefs.setBoolPref(
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer",
false
);

/**
* Test that non-existent files are handled correctly.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
function triggerKey() {
SpecialPowers.loadChromeScript(() => {
/* eslint-env mozilla/chrome-script */
const { EventUtils } = ChromeUtils.import(
"resource://specialpowers/SpecialPowersEventUtils.jsm"
);
var win = Services.wm.getMostRecentBrowserWindow();
for (let i = 0; i < 200; ++i) {
EventUtils.synthesizeKey("a", {}, win);
Expand Down
38 changes: 21 additions & 17 deletions dom/ipc/tests/test_sharedMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { ExtensionUtils } = ChromeUtils.import(
"resource://gre/modules/ExtensionUtils.jsm"
);
const { XPCShellContentUtils } = ChromeUtils.importESModule(
"resource://testing-common/XPCShellContentUtils.sys.mjs"
);
Expand All @@ -16,10 +19,6 @@ XPCShellContentUtils.init(this);
let contentPage;

async function readBlob(key, sharedData = Services.cpmm.sharedData) {
const { ExtensionUtils } = ChromeUtils.import(
"resource://gre/modules/ExtensionUtils.jsm"
);

let reader = new FileReader();
reader.readAsText(sharedData.get(key));
await ExtensionUtils.promiseEvent(reader, "loadend");
Expand Down Expand Up @@ -95,16 +94,21 @@ async function checkContentMaps(expected, parentOnly = false) {

if (!parentOnly) {
info("Checking out-of-process content map");
let contents = await contentPage.spawn([], getContents);
let contents = await contentPage.spawn(undefined, getContents);
checkMap(contents, expected);
}
}

async function loadContentPage() {
let page = await XPCShellContentUtils.loadContentPage("data:text/html,", {
let page = await XPCShellContentUtils.loadContentPage("about:blank", {
remote,
});
registerCleanupFunction(() => page.close());

page.addFrameScriptHelper(`
var {ExtensionUtils} = ChromeUtils.import("resource://gre/modules/ExtensionUtils.jsm");
Cu.importGlobalProperties(["FileReader"]);
`);
return page;
}

Expand Down Expand Up @@ -228,15 +232,15 @@ add_task(async function test_sharedMap() {
sharedData.set("grick", true);
sharedData.flush();
equal(
await contentPage.spawn(["grick"], hasKey),
await contentPage.spawn("grick", hasKey),
true,
"has() should see key after flush"
);

sharedData.set("grack", true);
sharedData.flush();
equal(
await contentPage.spawn(["gruck"], hasKey),
await contentPage.spawn("gruck", hasKey),
false,
"has() should return false for nonexistent key"
);
Expand Down Expand Up @@ -289,12 +293,12 @@ add_task(async function test_blobs() {
);

equal(
await contentPage.spawn(["blob0"], readBlob),
await contentPage.spawn("blob0", readBlob),
text[0],
"Expected text for blob0 in child 1 cpmm"
);
equal(
await contentPage.spawn(["blob1"], readBlob),
await contentPage.spawn("blob1", readBlob),
text[1],
"Expected text for blob1 in child 1 cpmm"
);
Expand All @@ -305,12 +309,12 @@ add_task(async function test_blobs() {
let page2 = await loadContentPage();

equal(
await page2.spawn(["blob0"], readBlob),
await page2.spawn("blob0", readBlob),
text[0],
"Expected text for blob0 in child 2 cpmm"
);
equal(
await page2.spawn(["blob1"], readBlob),
await page2.spawn("blob1", readBlob),
text[1],
"Expected text for blob1 in child 2 cpmm"
);
Expand Down Expand Up @@ -348,29 +352,29 @@ add_task(async function test_blobs() {
);

equal(
await contentPage.spawn(["blob0"], readBlob),
await contentPage.spawn("blob0", readBlob),
text[2],
"Expected text for blob0 in child 1 cpmm"
);
equal(
await contentPage.spawn(["blob1"], readBlob),
await contentPage.spawn("blob1", readBlob),
text[1],
"Expected text for blob1 in child 1 cpmm"
);

equal(
await page2.spawn(["blob0"], readBlob),
await page2.spawn("blob0", readBlob),
text[2],
"Expected text for blob0 in child 2 cpmm"
);
equal(
await page2.spawn(["blob1"], readBlob),
await page2.spawn("blob1", readBlob),
text[1],
"Expected text for blob1 in child 2 cpmm"
);

deepEqual(
await page2.spawn(["data"], getKey),
await page2.spawn("data", getKey),
data,
"Expected data for data key in child 2 cpmm"
);
Expand Down
8 changes: 4 additions & 4 deletions dom/workers/test/xpcshell/test_ext_redirects_sw_scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function ensureDataCleanup() {
// resulting install invocation. The installation's call to importScripts when evaluated
// will load the script directly out of the Cache API.
function testSWUpdate(contentPage) {
return contentPage.legacySpawn([], async () => {
return contentPage.spawn([], async () => {
const oldReg = await this.content.navigator.serviceWorker.ready;
const reg = await oldReg.update();
const sw = reg.installing || reg.waiting || reg.active;
Expand Down Expand Up @@ -178,7 +178,7 @@ add_task(async function test_extension_invalid_sw_scripts_redirect_ignored() {
// Register the worker while the test extension isn't loaded and cannot
// intercept and redirect the importedScripts requests.
info("Register service worker from a content webpage");
let workerMessage = await contentPage.legacySpawn([], async () => {
let workerMessage = await contentPage.spawn([], async () => {
const reg = await this.content.navigator.serviceWorker.register("/sw.js");
return new Promise(resolve => {
const { port1, port2 } = new MessageChannel();
Expand Down Expand Up @@ -281,7 +281,7 @@ add_task(async function test_filter_sw_script() {
"http://localhost/page.html"
);

let workerMessage = await contentPage.legacySpawn([], async () => {
let workerMessage = await contentPage.spawn([], async () => {
const reg = await this.content.navigator.serviceWorker.register("/sw.js");
return new Promise(resolve => {
const { port1, port2 } = new MessageChannel();
Expand Down Expand Up @@ -349,7 +349,7 @@ add_task(async function test_extension_redirect_sw_imported_script() {

// Register the worker while the test extension isn't loaded and cannot
// intercept and redirect the importedScripts requests.
let workerMessage = await contentPage.legacySpawn([], async () => {
let workerMessage = await contentPage.spawn([], async () => {
const reg = await this.content.navigator.serviceWorker.register("/sw.js");
return new Promise(resolve => {
const { port1, port2 } = new MessageChannel();
Expand Down
3 changes: 3 additions & 0 deletions dom/xhr/tests/file_sync_xhr_event_handling_helper.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
// InputTaskManager properly
SpecialPowers.loadChromeScript(() => {
/* eslint-env mozilla/chrome-script */
const { EventUtils } = ChromeUtils.import(
"resource://specialpowers/SpecialPowersEventUtils.jsm"
);
var win = Services.wm.getMostRecentBrowserWindow();
EventUtils.synthesizeKey("a", {}, win);
EventUtils.synthesizeKey("b", {}, win);
Expand Down
3 changes: 3 additions & 0 deletions dom/xhr/tests/file_sync_xhr_nested_helper.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
input.focus();
SpecialPowers.loadChromeScript(() => {
/* eslint-env mozilla/chrome-script */
const { EventUtils } = ChromeUtils.import(
"resource://specialpowers/SpecialPowersEventUtils.jsm"
);
var win = Services.wm.getMostRecentBrowserWindow();
EventUtils.synthesizeKey("a", {}, win);
});
Expand Down
7 changes: 0 additions & 7 deletions intl/l10n/test/test_localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@

const { AppConstants } = ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs");

// Disable `xpc::IsInAutomation()` so incomplete locales do not generate
// errors.
Services.prefs.setBoolPref(
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer",
false
);

add_task(function test_methods_presence() {
strictEqual(typeof Localization.prototype.formatValues, "function");
strictEqual(typeof Localization.prototype.formatMessages, "function");
Expand Down
7 changes: 0 additions & 7 deletions intl/l10n/test/test_localization_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@

const { AppConstants } = ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs");

// Disable `xpc::IsInAutomation()` so incomplete locales do not generate
// errors.
Services.prefs.setBoolPref(
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer",
false
);

add_task(function test_methods_calling() {
const l10nReg = new L10nRegistry();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ add_task(async function test_explicit_object_prototype() {
const url =
"http://mochi.test:8888/browser/js/xpconnect/tests/browser/browser_promise_userInteractionHandling.html";
await BrowserTestUtils.withNewTab(url, async browser => {
await SpecialPowers.spawn(browser, [], async () => {
await ContentTask.spawn(browser, {}, async () => {
const { EventUtils } = ChromeUtils.importESModule(
"resource://specialpowers/SpecialPowersEventUtils.sys.mjs"
);
const DOMWindowUtils = EventUtils._getDOMWindowUtils(content.window);
is(
DOMWindowUtils.isHandlingUserInput,
Expand Down
2 changes: 1 addition & 1 deletion js/xpconnect/tests/mochitest/test_bug960820.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// Check Components.stack, but first filter through the SpecialPowers junk.
var stack = SpecialPowers.wrap(SpecialPowers.Components).stack;
while (/testing-common/.test(stack)) {
while (/specialpowers/.test(stack)) {
stack = stack.caller;
}
ok(/clickCallback/.test(stack), "clickCallback should be reachable via Components.stack");
Expand Down
6 changes: 3 additions & 3 deletions modules/libpref/test/unit_ipc/test_sharedMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ add_task(async function test_sharedMap_prefs() {
contentPage.addFrameScriptHelper(getPref);

let prefNames = Object.keys(TESTS);
prefValues = await contentPage.legacySpawn(prefNames, getPrefs);
prefValues = await contentPage.spawn(prefNames, getPrefs);

await runChecks("contentStartup");

prefValues = await contentPage.legacySpawn(prefNames, getPrefs);
prefValues = await contentPage.spawn(prefNames, getPrefs);

await runChecks("contentUpdate1");

prefValues = await contentPage.legacySpawn(prefNames, getPrefs);
prefValues = await contentPage.spawn(prefNames, getPrefs);

await runChecks("contentUpdate2");
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ add_task(async function test_sharedMap_static_prefs() {
registerCleanupFunction(() => contentPage.close());

/* eslint-disable no-shadow */
let values = await contentPage.spawn([[PREF1_NAME, PREF2_NAME]], prefs => {
let values = await contentPage.spawn([PREF1_NAME, PREF2_NAME], prefs => {
return prefs.map(pref => Services.prefs.getBoolPref(pref));
});
/* eslint-enable no-shadow */
Expand Down
4 changes: 2 additions & 2 deletions netwerk/cookie/CookieXPCShellUtils.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const CookieXPCShellUtils = {
async getCookieStringFromDocument(uri, options = {}) {
const contentPage = await this.loadContentPage(uri, options);
const cookies = await contentPage.spawn(
[],
null,
// eslint-disable-next-line no-undef
() => content.document.cookie
);
Expand All @@ -48,7 +48,7 @@ export const CookieXPCShellUtils = {
async setCookieToDocument(uri, set, options = {}) {
const contentPage = await this.loadContentPage(uri, options);
await contentPage.spawn(
[set],
set,
// eslint-disable-next-line no-undef
cookies => (content.document.cookie = cookies)
);
Expand Down
10 changes: 4 additions & 6 deletions netwerk/test/unit/head_cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,10 @@ async function do_set_cookies(uri, channel, session, expected) {
const thirdPartyUrl = "http://third.com/";
const contentPage = await CookieXPCShellUtils.loadContentPage(thirdPartyUrl);
await contentPage.spawn(
[
{
cookie: "can=has" + suffix,
url: uri.spec,
},
],
{
cookie: "can=has" + suffix,
url: uri.spec,
},
async obj => {
// eslint-disable-next-line no-undef
await new content.Promise(resolve => {
Expand Down
6 changes: 5 additions & 1 deletion services/sync/tests/unit/test_prefs_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ AddonTestUtils.createAppInfo(
);
AddonTestUtils.overrideCertDB();

Services.prefs.setBoolPref("preferences.force-disable.check.once.policy", true);
// Attempting to set the
// security.turn_off_all_security_so_that_viruses_can_take_over_this_computer
// preference to enable Cu.exitIfInAutomation crashes, probably due to
// shutdown behaviors faked by AddonTestUtils.jsm's cleanup function.
do_disable_fast_shutdown();

add_task(async function run_test() {
_("Test fixtures.");
Expand Down
6 changes: 5 additions & 1 deletion services/sync/tests/unit/test_prefs_tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ const { Service } = ChromeUtils.importESModule(
"resource://services-sync/service.sys.mjs"
);

Services.prefs.setBoolPref("preferences.force-disable.check.once.policy", true);
// Attempting to set the
// security.turn_off_all_security_so_that_viruses_can_take_over_this_computer
// preference to enable Cu.exitIfInAutomation crashes, probably due to
// shutdown behaviors faked by AddonTestUtils.jsm's cleanup function.
do_disable_fast_shutdown();

add_task(async function run_test() {
let engine = Service.engineManager.get("prefs");
Expand Down
Loading

0 comments on commit 06b68d0

Please sign in to comment.