Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1834176) for causing xpc failures in tes…
Browse files Browse the repository at this point in the history
…t_unload.js CLOSED TREE

Backed out changeset 57876d77a652 (bug 1834176)
Backed out changeset ae2f0837b528 (bug 1834176)
  • Loading branch information
nerli1 committed May 23, 2023
1 parent 61ed1c4 commit aa2f146
Show file tree
Hide file tree
Showing 157 changed files with 332 additions and 392 deletions.
2 changes: 1 addition & 1 deletion browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ ChromeUtils.defineESModuleGetters(this, {
LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs",
LoginManagerParent: "resource://gre/modules/LoginManagerParent.sys.mjs",
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
PageThumbs: "resource://gre/modules/PageThumbs.sys.mjs",
Expand Down Expand Up @@ -91,6 +90,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
HomePage: "resource:///modules/HomePage.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
PageActions: "resource:///modules/PageActions.jsm",
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
Expand Down
8 changes: 5 additions & 3 deletions browser/base/content/test/performance/PerfTestHelpers.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

const lazy = {};

ChromeUtils.defineESModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);

export var PerfTestHelpers = {
/**
Expand Down
2 changes: 1 addition & 1 deletion browser/components/BrowserGlue.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
Interactions: "resource:///modules/Interactions.sys.mjs",
Log: "resource://gre/modules/Log.sys.mjs",
LoginBreaches: "resource:///modules/LoginBreaches.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
Normandy: "resource://normandy/Normandy.sys.mjs",
Expand Down Expand Up @@ -89,6 +88,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
Discovery: "resource:///modules/Discovery.jsm",
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
HomePage: "resource:///modules/HomePage.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
OnboardingMessageProvider:
"resource://activity-stream/lib/OnboardingMessageProvider.jsm",
PageActions: "resource:///modules/PageActions.jsm",
Expand Down
4 changes: 1 addition & 3 deletions browser/components/doh/test/unit/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

"use strict";

const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { PromiseUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PromiseUtils.sys.mjs"
);
Expand Down
2 changes: 1 addition & 1 deletion browser/components/downloads/DownloadsCommon.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ ChromeUtils.defineESModuleGetters(lazy, {
DownloadHistory: "resource://gre/modules/DownloadHistory.sys.mjs",
DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs",
Downloads: "resource://gre/modules/Downloads.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
});

XPCOMUtils.defineLazyModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
});

Expand Down
2 changes: 1 addition & 1 deletion browser/components/downloads/content/allDownloadsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ ChromeUtils.defineESModuleGetters(this, {
DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs",
DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs",
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
});

XPCOMUtils.defineLazyModuleGetters(this, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
});

/**
Expand Down
6 changes: 5 additions & 1 deletion browser/components/downloads/content/downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, {
DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs",
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
});
ChromeUtils.defineModuleGetter(
this,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);

const { Integration } = ChromeUtils.importESModule(
"resource://gre/modules/Integration.sys.mjs"
Expand Down
6 changes: 5 additions & 1 deletion browser/components/downloads/test/unit/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ ChromeUtils.defineESModuleGetters(this, {
DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs",
FileTestUtils: "resource://testing-common/FileTestUtils.sys.mjs",
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
});
ChromeUtils.defineModuleGetter(
this,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);

async function createDownloadedFile(pathname, contents) {
info("createDownloadedFile: " + pathname);
Expand Down
2 changes: 1 addition & 1 deletion browser/components/extensions/test/xpcshell/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const { AppConstants } = ChromeUtils.importESModule(
// eslint-disable-next-line no-unused-vars
ChromeUtils.defineESModuleGetters(this, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
});

Expand All @@ -21,6 +20,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
ExtensionData: "resource://gre/modules/Extension.jsm",
ExtensionTestUtils: "resource://testing-common/ExtensionXPCShellUtils.jsm",
HttpServer: "resource://testing-common/httpd.js",
NetUtil: "resource://gre/modules/NetUtil.jsm",
Schemas: "resource://gre/modules/Schemas.jsm",
});

Expand Down
6 changes: 5 additions & 1 deletion browser/components/migration/ChromeProfileMigrator.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const AUTH_TYPE = {
SCHEME_DIGEST: 2,
};

import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import { MigrationUtils } from "resource:///modules/MigrationUtils.sys.mjs";
import { MigratorBase } from "resource:///modules/MigratorBase.sys.mjs";
Expand All @@ -19,11 +20,14 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
ChromeMigrationUtils: "resource:///modules/ChromeMigrationUtils.sys.mjs",
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
Qihoo360seMigrationUtils: "resource:///modules/360seMigrationUtils.sys.mjs",
});

XPCOMUtils.defineLazyModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});

/**
* Converts an array of chrome bookmark objects into one our own places code
* understands.
Expand Down
4 changes: 1 addition & 3 deletions browser/components/migration/tests/unit/head_migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ var { MigrationUtils } = ChromeUtils.importESModule(
var { LoginHelper } = ChromeUtils.importESModule(
"resource://gre/modules/LoginHelper.sys.mjs"
);
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var { PlacesUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PlacesUtils.sys.mjs"
);
Expand Down
9 changes: 8 additions & 1 deletion browser/components/search/test/unit/test_urlTelemetry.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */

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

ChromeUtils.defineESModuleGetters(this, {
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
sinon: "resource://testing-common/Sinon.sys.mjs",
});

XPCOMUtils.defineLazyModuleGetters(this, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});

const TESTS = [
{
title: "Google search access point",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */

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

ChromeUtils.defineESModuleGetters(this, {
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
SearchSERPTelemetryUtils: "resource:///modules/SearchSERPTelemetry.sys.mjs",
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
sinon: "resource://testing-common/Sinon.sys.mjs",
});

XPCOMUtils.defineLazyModuleGetters(this, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});

const TEST_PROVIDER_INFO = [
{
telemetryId: "example",
Expand Down
4 changes: 1 addition & 3 deletions browser/components/sessionstore/test/coopHeaderCommon.sjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
function handleRequest(request, response) {
Cu.importGlobalProperties(["URLSearchParams"]);
let { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
let { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
let query = new URLSearchParams(request.queryString);

response.setHeader("Cross-Origin-Opener-Policy", "same-origin", false);
Expand Down
4 changes: 1 addition & 3 deletions browser/modules/WindowsPreviewPerTab.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
*/
var EXPORTED_SYMBOLS = ["AeroPeek"];

const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { PlacesUtils } = ChromeUtils.importESModule(
"resource://gre/modules/PlacesUtils.sys.mjs"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { UrlClassifierTestUtils } from "resource://testing-common/UrlClassifierT

import { SitePermissions } from "resource:///modules/SitePermissions.sys.mjs";

import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");

const CC_SELECTORS = ["#identity-popup", "#urlbar-input-container"];
const PP_SELECTORS = ["#protections-popup", "#urlbar-input-container"];
Expand Down
4 changes: 1 addition & 3 deletions chrome/test/unit/test_create_channel_chrome_url.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

"use strict";

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

function testURL(url) {
Services.io.newChannelFromURI(
Expand Down
6 changes: 5 additions & 1 deletion devtools/client/shared/remote-debugging/adb/adb-binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ ChromeUtils.defineModuleGetter(
);
ChromeUtils.defineESModuleGetters(lazy, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);
loader.lazyGetter(this, "UNPACKED_ROOT_PATH", () => {
return PathUtils.join(PathUtils.localProfileDir, "adb");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
const { ExtensionTestUtils } = ChromeUtils.import(
"resource://testing-common/ExtensionXPCShellUtils.jsm"
);
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const {
getFileForBinary,
} = require("resource://devtools/client/shared/remote-debugging/adb/adb-binary.js");
Expand Down
6 changes: 5 additions & 1 deletion devtools/client/styleeditor/StyleEditorUI.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ loader.lazyRequireGetter(

ChromeUtils.defineESModuleGetters(lazy, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);
loader.lazyRequireGetter(
lazy,
"ResponsiveUIManager",
Expand Down
6 changes: 5 additions & 1 deletion devtools/client/styleeditor/StyleSheetEditor.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ loader.lazyGetter(lazy, "BufferStream", () => {

ChromeUtils.defineESModuleGetters(lazy, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);

import {
getString,
Expand Down
6 changes: 5 additions & 1 deletion devtools/server/actors/network-monitor/network-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ const {
} = require("resource://devtools/shared/specs/network-content.js");

const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);

ChromeUtils.defineESModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
NetworkUtils:
"resource://devtools/shared/network-observer/NetworkUtils.sys.mjs",
});
Expand Down
4 changes: 1 addition & 3 deletions devtools/server/tests/xpcshell/head_dbg.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const { worker } = ChromeUtils.import(
"resource://devtools/shared/loader/worker-loader.js"
);

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

// Always log packets when running tests. runxpcshelltests.py will throw
// the output away anyway, unless you give it the --verbose flag.
Expand Down
3 changes: 1 addition & 2 deletions devtools/shared/DevToolsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,7 @@ Object.defineProperty(exports, "assert", {
});

DevToolsUtils.defineLazyGetter(this, "NetUtil", () => {
return ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs")
.NetUtil;
return ChromeUtils.import("resource://gre/modules/NetUtil.jsm").NetUtil;
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ add_task(async function testParentProcessRequests() {
tab.linkedBrowser,
[requestUrl],
async function (uri) {
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
const { NetUtil } = ChromeUtils.import(
"resource://gre/modules/NetUtil.jsm"
);
const channel = NetUtil.newChannel({
uri,
Expand Down Expand Up @@ -198,8 +198,8 @@ add_task(async function testParentProcessRequests() {
secondTab.linkedBrowser,
[requestUrl],
async function (uri) {
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
const { NetUtil } = ChromeUtils.import(
"resource://gre/modules/NetUtil.jsm"
);
const channel = NetUtil.newChannel({
uri,
Expand Down
8 changes: 5 additions & 3 deletions devtools/shared/layout/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ loader.lazyRequireGetter(
"resource://devtools/shared/DevToolsUtils.js"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);

const SHEET_TYPE = {
agent: "AGENT_SHEET",
Expand Down
8 changes: 5 additions & 3 deletions devtools/shared/loader/base-loader.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ XPCOMUtils.defineLazyServiceGetter(
"nsIResProtocolHandler"
);

ChromeUtils.defineESModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);

// Define some shortcuts.
function* getOwnIdentifiers(x) {
Expand Down
Loading

0 comments on commit aa2f146

Please sign in to comment.