Skip to content

Commit

Permalink
Backed out changeset 5018856d8fee (bug 1758474) for causing node esli…
Browse files Browse the repository at this point in the history
…nt failure. CLOSED TREE
  • Loading branch information
smolnar committed Mar 10, 2022
1 parent 25efd98 commit ab5da6c
Show file tree
Hide file tree
Showing 82 changed files with 218 additions and 189 deletions.
3 changes: 2 additions & 1 deletion browser/base/content/browser-fullScreenAndPointerLock.js
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ var FullScreen = {

XPCOMUtils.defineLazyGetter(FullScreen, "_permissionNotificationIDs", () => {
let { PermissionUI } = ChromeUtils.import(
"resource:///modules/PermissionUI.jsm"
"resource:///modules/PermissionUI.jsm",
{}
);
return (
Object.values(PermissionUI)
Expand Down
6 changes: 4 additions & 2 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,8 @@ var gBrowserInit = {
) {
let windowFrameColor = new Color(
...ChromeUtils.import(
"resource:///modules/Windows8WindowFrameColor.jsm"
"resource:///modules/Windows8WindowFrameColor.jsm",
{}
).Windows8WindowFrameColor.get()
);
// Default to black for foreground text.
Expand Down Expand Up @@ -2338,7 +2339,8 @@ var gBrowserInit = {
try {
DownloadsCommon.initializeAllDataLinks();
ChromeUtils.import(
"resource:///modules/DownloadsTaskbar.jsm"
"resource:///modules/DownloadsTaskbar.jsm",
{}
).DownloadsTaskbar.registerIndicator(window);
if (AppConstants.platform == "macosx") {
ChromeUtils.import(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

// Pass an empty scope object to the import to prevent "leaked window property"
// errors in tests.
var { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
);
var { TelemetryReportingPolicy } = ChromeUtils.import(
"resource://gre/modules/TelemetryReportingPolicy.jsm"
);
var Preferences = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm",
{}
).Preferences;
var TelemetryReportingPolicy = ChromeUtils.import(
"resource://gre/modules/TelemetryReportingPolicy.jsm",
{}
).TelemetryReportingPolicy;

const PREF_BRANCH = "datareporting.policy.";
const PREF_FIRST_RUN = "toolkit.telemetry.reportingpolicy.firstRun";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ add_task(async function() {

let updateChannel = null;
try {
updateChannel = ChromeUtils.import("resource://gre/modules/UpdateUtils.jsm")
.UpdateUtils.UpdateChannel;
updateChannel = ChromeUtils.import(
"resource://gre/modules/UpdateUtils.jsm",
{}
).UpdateUtils.UpdateChannel;
} catch (ex) {}
if (!updateChannel) {
Assert.ok(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ add_task(async function checkAllTheDTDs() {
add_task(async function checkAllTheFluents() {
let uris = await getAllTheFiles(".ftl");
let { FluentParser, Visitor } = ChromeUtils.import(
"resource://testing-common/FluentSyntax.jsm"
"resource://testing-common/FluentSyntax.jsm",
{}
);

class TextElementVisitor extends Visitor {
Expand Down
7 changes: 4 additions & 3 deletions browser/base/content/test/static/browser_parsable_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,10 @@ add_task(async function checkAllTheCSS() {
// Create a clean iframe to load all the files into. This needs to live at a
// chrome URI so that it's allowed to load and parse any styles.
let testFile = getRootDirectory(gTestPath) + "dummy_page.html";
let { HiddenFrame } = ChromeUtils.import(
"resource://gre/modules/HiddenFrame.jsm"
);
let HiddenFrame = ChromeUtils.import(
"resource://gre/modules/HiddenFrame.jsm",
{}
).HiddenFrame;
let hiddenFrame = new HiddenFrame();
let win = await hiddenFrame.get();
let iframe = win.document.createElementNS(
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/sync/browser_fxa_web_channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function() {
return ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
return ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js", {});
});

ChromeUtils.defineModuleGetter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const { AddonManagerPrivate } = ChromeUtils.import(
);

const { AddonTestUtils } = ChromeUtils.import(
"resource://testing-common/AddonTestUtils.jsm"
"resource://testing-common/AddonTestUtils.jsm",
{}
);

AddonTestUtils.initMochitest(this);
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/webrtc/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function promiseIndicatorWindow() {
}

async function assertWebRTCIndicatorStatus(expected) {
let ui = ChromeUtils.import("resource:///modules/webrtcUI.jsm").webrtcUI;
let ui = ChromeUtils.import("resource:///modules/webrtcUI.jsm", {}).webrtcUI;
let expectedState = expected ? "visible" : "hidden";
let msg = "WebRTC indicator " + expectedState;
if (!expected && ui.showGlobalIndicator) {
Expand Down
3 changes: 2 additions & 1 deletion browser/components/BrowserGlue.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,8 @@ BrowserGlue.prototype = {
let updateChannel;
try {
updateChannel = ChromeUtils.import(
"resource://gre/modules/UpdateUtils.jsm"
"resource://gre/modules/UpdateUtils.jsm",
{}
).UpdateUtils.UpdateChannel;
} catch (ex) {}
if (updateChannel) {
Expand Down
3 changes: 2 additions & 1 deletion browser/components/attribution/AttributionCode.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ChromeUtils.defineModuleGetter(
"resource:///modules/MacAttribution.jsm"
);
XPCOMUtils.defineLazyGetter(this, "log", () => {
let { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
let ConsoleAPI = ChromeUtils.import("resource://gre/modules/Console.jsm", {})
.ConsoleAPI;
let consoleOptions = {
// tip: set maxLogLevel to "debug" and use log.debug() to create detailed
// messages during development. See LOG_LEVELS in Console.jsm for details.
Expand Down
3 changes: 2 additions & 1 deletion browser/components/attribution/MacAttribution.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
XPCOMUtils.defineLazyGetter(this, "log", () => {
let { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
let ConsoleAPI = ChromeUtils.import("resource://gre/modules/Console.jsm", {})
.ConsoleAPI;
let consoleOptions = {
// tip: set maxLogLevel to "debug" and use log.debug() to create detailed
// messages during development. See LOG_LEVELS in Console.jsm for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ function checkSubviewButtonClass(menuId, buttonId, subviewId) {
return async function() {
// Initialize DevTools before starting the test in order to create menuitems in
// menuWebDeveloperPopup.
ChromeUtils.import("resource://devtools/shared/loader/Loader.jsm").require(
"devtools/client/framework/devtools-browser"
);
ChromeUtils.import(
"resource://devtools/shared/loader/Loader.jsm",
{}
).require("devtools/client/framework/devtools-browser");

info(
"Checking for items without the subviewbutton class in " +
Expand Down
7 changes: 4 additions & 3 deletions browser/components/distribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,10 @@ DistributionCustomizer.prototype = {
return;
}

let { ProfileAge } = ChromeUtils.import(
"resource://gre/modules/ProfileAge.jsm"
);
let ProfileAge = ChromeUtils.import(
"resource://gre/modules/ProfileAge.jsm",
{}
).ProfileAge;
let profileAge = await ProfileAge();
let resetDate = await profileAge.reset;

Expand Down
3 changes: 2 additions & 1 deletion browser/components/migration/ESEDBReader.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const { XPCOMUtils } = ChromeUtils.import(
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyGetter(this, "log", () => {
let { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
let ConsoleAPI = ChromeUtils.import("resource://gre/modules/Console.jsm", {})
.ConsoleAPI;
let consoleOptions = {
maxLogLevelPref: "browser.esedbreader.loglevel",
prefix: "ESEDBReader",
Expand Down
3 changes: 2 additions & 1 deletion browser/components/preferences/fxaPairDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ XPCOMUtils.defineLazyModuleGetters(this, {
FxAccountsPairingFlow: "resource://gre/modules/FxAccountsPairing.jsm",
});
const { require } = ChromeUtils.import(
"resource://devtools/shared/loader/Loader.jsm"
"resource://devtools/shared/loader/Loader.jsm",
{}
);
const QR = require("devtools/shared/qrcode/index");

Expand Down
2 changes: 1 addition & 1 deletion browser/components/preferences/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* import-globals-from preferences.js */

XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function() {
return ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js");
return ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js", {});
});

const FXA_PAGE_LOGGED_OUT = 0;
Expand Down
8 changes: 6 additions & 2 deletions browser/components/preferences/tests/browser_sync_pairing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

"use strict";

const { UIState } = ChromeUtils.import("resource://services-sync/UIState.jsm");
const { UIState } = ChromeUtils.import(
"resource://services-sync/UIState.jsm",
{}
);
const { FxAccountsPairingFlow } = ChromeUtils.import(
"resource://gre/modules/FxAccountsPairing.jsm"
"resource://gre/modules/FxAccountsPairing.jsm",
{}
);

// Use sinon for mocking.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ function clearHistoryAndWait() {
*/

async function runTest() {
let { FileUtils } = ChromeUtils.import(
"resource://gre/modules/FileUtils.jsm"
);
let { DownloadLastDir } = ChromeUtils.import(
"resource://gre/modules/DownloadLastDir.jsm"
);
let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm", {})
.FileUtils;
let DownloadLastDir = ChromeUtils.import(
"resource://gre/modules/DownloadLastDir.jsm",
{}
).DownloadLastDir;

let tmpDir = FileUtils.getDir("TmpD", [], true);
let dir1 = newDirectory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
function test() {
waitForExplicitFinish();

let { FileUtils } = ChromeUtils.import(
"resource://gre/modules/FileUtils.jsm"
);
let { DownloadLastDir } = ChromeUtils.import(
"resource://gre/modules/DownloadLastDir.jsm"
);
let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm", {})
.FileUtils;
let DownloadLastDir = ChromeUtils.import(
"resource://gre/modules/DownloadLastDir.jsm",
{}
).DownloadLastDir;
let MockFilePicker = SpecialPowers.MockFilePicker;
let launcher = {
source: Services.io.newURI("http://test1.com/file"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
function test() {
waitForExplicitFinish();

let { FileUtils } = ChromeUtils.import(
"resource://gre/modules/FileUtils.jsm"
);
let { DownloadLastDir } = ChromeUtils.import(
"resource://gre/modules/DownloadLastDir.jsm"
);
let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm", {})
.FileUtils;
let DownloadLastDir = ChromeUtils.import(
"resource://gre/modules/DownloadLastDir.jsm",
{}
).DownloadLastDir;
let MockFilePicker = SpecialPowers.MockFilePicker;

MockFilePicker.init(window);
Expand Down
9 changes: 4 additions & 5 deletions browser/components/privatebrowsing/test/browser/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ ChromeUtils.defineModuleGetter(
"TestUtils",
"resource://testing-common/TestUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"FileUtils",
"resource://gre/modules/FileUtils.jsm"
);

function whenNewWindowLoaded(aOptions, aCallback) {
let win = OpenBrowserWindow(aOptions);
Expand Down Expand Up @@ -61,6 +56,8 @@ async function openAboutPrivateBrowsing() {
}

function newDirectory() {
let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm", {})
.FileUtils;
let tmpDir = FileUtils.getDir("TmpD", [], true);
let dir = tmpDir.clone();
dir.append("testdir");
Expand All @@ -69,6 +66,8 @@ function newDirectory() {
}

function newFileInDirectory(aDir) {
let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm", {})
.FileUtils;
let file = aDir.clone();
file.append("testfile");
file.createUnique(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_FILE);
Expand Down
6 changes: 4 additions & 2 deletions browser/components/search/content/searchbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@
window.addEventListener("unload", this.destroy);

this.FormHistory = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
"resource://gre/modules/FormHistory.jsm",
{}
).FormHistory;
this.SearchSuggestionController = ChromeUtils.import(
"resource://gre/modules/SearchSuggestionController.jsm"
"resource://gre/modules/SearchSuggestionController.jsm",
{}
).SearchSuggestionController;

Services.obs.addObserver(this.observer, "browser-search-engine-modified");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

"use strict";

var { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
);
var Preferences = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm",
{}
).Preferences;

function test() {
waitForExplicitFinish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ add_task(async function test_add() {

add_task(async function test_diacritics() {
const diacritic_engine = "Foo \u2661";
let { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
);
let Preferences = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm",
{}
).Preferences;

Preferences.set("browser.search.hiddenOneOffs", diacritic_engine);
await SearchTestUtils.promiseNewSearchEngine(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const searchPopup = document.getElementById("PopupSearchAutoComplete");

const diacritic_engine = "Foo \u2661";

var { Preferences } = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm"
);
var Preferences = ChromeUtils.import(
"resource://gre/modules/Preferences.jsm",
{}
).Preferences;

let searchIcon;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ add_task(async function init() {
// Make sure that we have a profile before initializing SessionFile
let profd = do_get_profile();
SessionFile = ChromeUtils.import(
"resource:///modules/sessionstore/SessionFile.jsm"
"resource:///modules/sessionstore/SessionFile.jsm",
{}
).SessionFile;
Paths = SessionFile.Paths;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ add_task(async function test_migration() {
// Make sure that we have a profile before initializing SessionFile.
let profd = do_get_profile();
SessionFile = ChromeUtils.import(
"resource:///modules/sessionstore/SessionFile.jsm"
"resource:///modules/sessionstore/SessionFile.jsm",
{}
).SessionFile;
Paths = SessionFile.Paths;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
function run_test() {
let profd = do_get_profile();
var SessionFile = ChromeUtils.import(
"resource:///modules/sessionstore/SessionFile.jsm"
"resource:///modules/sessionstore/SessionFile.jsm",
{}
).SessionFile;

let sourceSession = do_get_file("data/sessionstore_invalid.js");
Expand Down
Loading

0 comments on commit ab5da6c

Please sign in to comment.