Bug 1845311 - [Part 2] Use ChromeUtils.defineLazyGetter in more places r=arai,webcompat-reviewers,necko-reviewers,extension-reviewers,settings-reviewers,application-update-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,sync-reviewers,anti-tracking-reviewers,tabbrowser-reviewers,bytesized,twisniewski,sgalich,mak,kershaw,sclements,pbz,robwu,geckoview-reviewers,amejiamarmol

Differential Revision: https://phabricator.services.mozilla.com/D184623
This commit is contained in:
Gregory Pappas 2023-08-01 23:01:02 +00:00
Родитель f66262afd1
Коммит 8a35d5cf5f
208 изменённых файлов: 393 добавлений и 403 удалений

Просмотреть файл

@ -20,7 +20,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
SITEPERMS_ADDON_TYPE:
"resource://gre/modules/addons/siteperms-addon-utils.sys.mjs",
});
XPCOMUtils.defineLazyGetter(lazy, "l10n", function () {
ChromeUtils.defineLazyGetter(lazy, "l10n", function () {
return new Localization(
["browser/addonNotifications.ftl", "branding/brand.ftl"],
true

Просмотреть файл

@ -937,7 +937,7 @@ var FullScreen = {
},
};
XPCOMUtils.defineLazyGetter(FullScreen, "_permissionNotificationIDs", () => {
ChromeUtils.defineLazyGetter(FullScreen, "_permissionNotificationIDs", () => {
let { PermissionUI } = ChromeUtils.importESModule(
"resource:///modules/PermissionUI.sys.mjs"
);

Просмотреть файл

@ -81,29 +81,29 @@ class ProtectionCategory {
l10nId = l10nId || id;
this.strings = {};
XPCOMUtils.defineLazyGetter(this.strings, "subViewBlocked", () =>
ChromeUtils.defineLazyGetter(this.strings, "subViewBlocked", () =>
gNavigatorBundle.getString(`contentBlocking.${l10nId}View.blocked.label`)
);
XPCOMUtils.defineLazyGetter(this.strings, "subViewTitleBlocking", () =>
ChromeUtils.defineLazyGetter(this.strings, "subViewTitleBlocking", () =>
gNavigatorBundle.getString(`protections.blocking.${l10nId}.title`)
);
XPCOMUtils.defineLazyGetter(this.strings, "subViewTitleNotBlocking", () =>
ChromeUtils.defineLazyGetter(this.strings, "subViewTitleNotBlocking", () =>
gNavigatorBundle.getString(`protections.notBlocking.${l10nId}.title`)
);
XPCOMUtils.defineLazyGetter(this, "subView", () =>
ChromeUtils.defineLazyGetter(this, "subView", () =>
document.getElementById(`protections-popup-${this._id}View`)
);
XPCOMUtils.defineLazyGetter(this, "subViewHeading", () =>
ChromeUtils.defineLazyGetter(this, "subViewHeading", () =>
document.getElementById(`protections-popup-${this._id}View-heading`)
);
XPCOMUtils.defineLazyGetter(this, "subViewList", () =>
ChromeUtils.defineLazyGetter(this, "subViewList", () =>
document.getElementById(`protections-popup-${this._id}View-list`)
);
XPCOMUtils.defineLazyGetter(this, "subViewShimAllowHint", () =>
ChromeUtils.defineLazyGetter(this, "subViewShimAllowHint", () =>
document.getElementById(
`protections-popup-${this._id}View-shim-allow-hint`
)
@ -363,7 +363,7 @@ let TrackingProtection =
);
// Blocked label has custom key, overwrite the getter.
XPCOMUtils.defineLazyGetter(this.strings, "subViewBlocked", () =>
ChromeUtils.defineLazyGetter(this.strings, "subViewBlocked", () =>
gNavigatorBundle.getString("contentBlocking.trackersView.blocked.label")
);
@ -607,19 +607,22 @@ let ThirdPartyCookies =
}
);
XPCOMUtils.defineLazyGetter(this, "categoryLabel", () =>
ChromeUtils.defineLazyGetter(this, "categoryLabel", () =>
document.getElementById("protections-popup-cookies-category-label")
);
// Not blocking title has custom key, overwrite the getter.
XPCOMUtils.defineLazyGetter(this.strings, "subViewTitleNotBlocking", () =>
gNavigatorBundle.getString(
"protections.notBlocking.crossSiteTrackingCookies.title"
)
ChromeUtils.defineLazyGetter(
this.strings,
"subViewTitleNotBlocking",
() =>
gNavigatorBundle.getString(
"protections.notBlocking.crossSiteTrackingCookies.title"
)
);
// Cookie permission state label.
XPCOMUtils.defineLazyGetter(this.strings, "subViewAllowed", () =>
ChromeUtils.defineLazyGetter(this.strings, "subViewAllowed", () =>
gNavigatorBundle.getString("contentBlocking.cookiesView.allowed.label")
);
@ -1143,24 +1146,24 @@ let cookieBannerHandling = new (class {
"cookiebanners.ui.desktop.enabled",
false
);
XPCOMUtils.defineLazyGetter(this, "_cookieBannerSection", () =>
ChromeUtils.defineLazyGetter(this, "_cookieBannerSection", () =>
document.getElementById("protections-popup-cookie-banner-section")
);
XPCOMUtils.defineLazyGetter(this, "_cookieBannerSectionSeparator", () =>
ChromeUtils.defineLazyGetter(this, "_cookieBannerSectionSeparator", () =>
document.getElementById(
"protections-popup-cookie-banner-section-separator"
)
);
XPCOMUtils.defineLazyGetter(this, "_cookieBannerSwitch", () =>
ChromeUtils.defineLazyGetter(this, "_cookieBannerSwitch", () =>
document.getElementById("protections-popup-cookie-banner-switch")
);
XPCOMUtils.defineLazyGetter(this, "_cookieBannerSubview", () =>
ChromeUtils.defineLazyGetter(this, "_cookieBannerSubview", () =>
document.getElementById("protections-popup-cookieBannerView")
);
XPCOMUtils.defineLazyGetter(this, "_cookieBannerEnableSite", () =>
ChromeUtils.defineLazyGetter(this, "_cookieBannerEnableSite", () =>
document.getElementById("cookieBannerView-enable-site")
);
XPCOMUtils.defineLazyGetter(this, "_cookieBannerDisableSite", () =>
ChromeUtils.defineLazyGetter(this, "_cookieBannerDisableSite", () =>
document.getElementById("cookieBannerView-disable-site")
);
}

Просмотреть файл

@ -100,7 +100,7 @@ var gBrowserThumbnails = {
}
// Delete the defined property
delete this._topSiteURLs;
XPCOMUtils.defineLazyGetter(this, "_topSiteURLs", getTopSiteURLs);
ChromeUtils.defineLazyGetter(this, "_topSiteURLs", getTopSiteURLs);
},
notify: function Thumbnails_notify(timer) {
@ -221,4 +221,8 @@ async function getTopSiteURLs() {
}, []);
}
XPCOMUtils.defineLazyGetter(gBrowserThumbnails, "_topSiteURLs", getTopSiteURLs);
ChromeUtils.defineLazyGetter(
gBrowserThumbnails,
"_topSiteURLs",
getTopSiteURLs
);

Просмотреть файл

@ -103,7 +103,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
CFRPageActions: "resource://activity-stream/lib/CFRPageActions.jsm",
});
XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => {
ChromeUtils.defineLazyGetter(this, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
).getFxAccountsSingleton();
@ -309,34 +309,34 @@ if (AppConstants.ENABLE_WEBDRIVER) {
this.RemoteAgent = { running: false };
}
XPCOMUtils.defineLazyGetter(this, "RTL_UI", () => {
ChromeUtils.defineLazyGetter(this, "RTL_UI", () => {
return Services.locale.isAppLocaleRTL;
});
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", () => {
ChromeUtils.defineLazyGetter(this, "gBrandBundle", () => {
return Services.strings.createBundle(
"chrome://branding/locale/brand.properties"
);
});
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", () => {
ChromeUtils.defineLazyGetter(this, "gBrowserBundle", () => {
return Services.strings.createBundle(
"chrome://browser/locale/browser.properties"
);
});
XPCOMUtils.defineLazyGetter(this, "gCustomizeMode", () => {
ChromeUtils.defineLazyGetter(this, "gCustomizeMode", () => {
let { CustomizeMode } = ChromeUtils.importESModule(
"resource:///modules/CustomizeMode.sys.mjs"
);
return new CustomizeMode(window);
});
XPCOMUtils.defineLazyGetter(this, "gNavToolbox", () => {
ChromeUtils.defineLazyGetter(this, "gNavToolbox", () => {
return document.getElementById("navigator-toolbox");
});
XPCOMUtils.defineLazyGetter(this, "gURLBar", () => {
ChromeUtils.defineLazyGetter(this, "gURLBar", () => {
let urlbar = new UrlbarInput({
textbox: document.getElementById("urlbar"),
eventTelemetryCategory: "urlbar",
@ -379,7 +379,7 @@ XPCOMUtils.defineLazyGetter(this, "gURLBar", () => {
return urlbar;
});
XPCOMUtils.defineLazyGetter(this, "ReferrerInfo", () =>
ChromeUtils.defineLazyGetter(this, "ReferrerInfo", () =>
Components.Constructor(
"@mozilla.org/referrer-info;1",
"nsIReferrerInfo",
@ -388,7 +388,7 @@ XPCOMUtils.defineLazyGetter(this, "ReferrerInfo", () =>
);
// High priority notification bars shown at the top of the window.
XPCOMUtils.defineLazyGetter(this, "gNotificationBox", () => {
ChromeUtils.defineLazyGetter(this, "gNotificationBox", () => {
return new MozElements.NotificationBox(element => {
element.classList.add("global-notificationbox");
element.setAttribute("notificationside", "top");
@ -398,14 +398,14 @@ XPCOMUtils.defineLazyGetter(this, "gNotificationBox", () => {
});
});
XPCOMUtils.defineLazyGetter(this, "InlineSpellCheckerUI", () => {
ChromeUtils.defineLazyGetter(this, "InlineSpellCheckerUI", () => {
let { InlineSpellChecker } = ChromeUtils.importESModule(
"resource://gre/modules/InlineSpellChecker.sys.mjs"
);
return new InlineSpellChecker();
});
XPCOMUtils.defineLazyGetter(this, "PopupNotifications", () => {
ChromeUtils.defineLazyGetter(this, "PopupNotifications", () => {
// eslint-disable-next-line no-shadow
let { PopupNotifications } = ChromeUtils.importESModule(
"resource://gre/modules/PopupNotifications.sys.mjs"
@ -460,7 +460,7 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", () => {
}
});
XPCOMUtils.defineLazyGetter(this, "MacUserActivityUpdater", () => {
ChromeUtils.defineLazyGetter(this, "MacUserActivityUpdater", () => {
if (AppConstants.platform != "macosx") {
return null;
}
@ -470,7 +470,7 @@ XPCOMUtils.defineLazyGetter(this, "MacUserActivityUpdater", () => {
);
});
XPCOMUtils.defineLazyGetter(this, "Win7Features", () => {
ChromeUtils.defineLazyGetter(this, "Win7Features", () => {
if (AppConstants.platform != "win") {
return null;
}
@ -2511,7 +2511,7 @@ var gBrowserInit = {
},
};
XPCOMUtils.defineLazyGetter(
ChromeUtils.defineLazyGetter(
gBrowserInit,
"_firstContentWindowPaintDeferred",
() => PromiseUtils.defer()

Просмотреть файл

@ -92,7 +92,7 @@
"nsIMacSharingService",
],
});
XPCOMUtils.defineLazyGetter(this, "tabLocalization", () => {
ChromeUtils.defineLazyGetter(this, "tabLocalization", () => {
return new Localization(
["browser/tabbrowser.ftl", "branding/brand.ftl"],
true

Просмотреть файл

@ -277,7 +277,7 @@ function checkPopup(popup, notifyObj) {
});
}
XPCOMUtils.defineLazyGetter(this, "gActiveListeners", () => {
ChromeUtils.defineLazyGetter(this, "gActiveListeners", () => {
let listeners = new Map();
registerCleanupFunction(() => {
for (let [listener, eventName] of listeners) {

Просмотреть файл

@ -12,7 +12,7 @@ XPCOMUtils.defineLazyServiceGetter(
"nsITrackingDBService"
);
XPCOMUtils.defineLazyGetter(this, "TRACK_DB_PATH", function () {
ChromeUtils.defineLazyGetter(this, "TRACK_DB_PATH", function () {
return PathUtils.join(PathUtils.profileDir, "protections.sqlite");
});

Просмотреть файл

@ -7,7 +7,7 @@ const BASE = getRootDirectory(gTestPath).replace(
"https://example.com/"
);
XPCOMUtils.defineLazyGetter(this, "Management", () => {
ChromeUtils.defineLazyGetter(this, "Management", () => {
// eslint-disable-next-line no-shadow
const { Management } = ChromeUtils.importESModule(
"resource://gre/modules/Extension.sys.mjs"

Просмотреть файл

@ -24,7 +24,7 @@ ChromeUtils.defineESModuleGetters(this, {
URILoadingHelper: "resource:///modules/URILoadingHelper.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "ReferrerInfo", () =>
ChromeUtils.defineLazyGetter(this, "ReferrerInfo", () =>
Components.Constructor(
"@mozilla.org/referrer-info;1",
"nsIReferrerInfo",

Просмотреть файл

@ -3,7 +3,7 @@
"use strict";
XPCOMUtils.defineLazyGetter(this, "DevToolsStartup", () => {
ChromeUtils.defineLazyGetter(this, "DevToolsStartup", () => {
return Cc["@mozilla.org/devtools/startup-clh;1"].getService(
Ci.nsICommandLineHandler
).wrappedJSObject;

Просмотреть файл

@ -1670,13 +1670,13 @@ var DownloadsBlockedSubview = {
},
};
XPCOMUtils.defineLazyGetter(DownloadsBlockedSubview, "panelMultiView", () =>
ChromeUtils.defineLazyGetter(DownloadsBlockedSubview, "panelMultiView", () =>
document.getElementById("downloadsPanel-multiView")
);
XPCOMUtils.defineLazyGetter(DownloadsBlockedSubview, "mainView", () =>
ChromeUtils.defineLazyGetter(DownloadsBlockedSubview, "mainView", () =>
document.getElementById("downloadsPanel-mainView")
);
XPCOMUtils.defineLazyGetter(DownloadsBlockedSubview, "subview", () =>
ChromeUtils.defineLazyGetter(DownloadsBlockedSubview, "subview", () =>
document.getElementById("downloadsPanel-blockedSubview")
);

Просмотреть файл

@ -6,10 +6,6 @@
"use strict";
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
ChromeUtils.defineESModuleGetters(this, {
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
});
@ -26,7 +22,7 @@ const BOOKMARKS_TYPES_TO_API_TYPES_MAP = new Map([
const BOOKMARK_SEPERATOR_URL = "data:";
XPCOMUtils.defineLazyGetter(this, "API_TYPES_TO_BOOKMARKS_TYPES_MAP", () => {
ChromeUtils.defineLazyGetter(this, "API_TYPES_TO_BOOKMARKS_TYPES_MAP", () => {
let theMap = new Map();
for (let [code, name] of BOOKMARKS_TYPES_TO_API_TYPES_MAP) {

Просмотреть файл

@ -243,7 +243,7 @@ global.TabContext = class extends EventEmitter {
// None of the code in the WebExtension modules requests that initialization.
// It is assumed that it is started at some point. That might never happen,
// e.g. if the application shuts down before the search service initializes.
XPCOMUtils.defineLazyGetter(global, "searchInitialized", () => {
ChromeUtils.defineLazyGetter(global, "searchInitialized", () => {
if (Services.search.isInitialized) {
return Promise.resolve();
}

Просмотреть файл

@ -32,7 +32,7 @@ const POPUP_PRELOAD_TIMEOUT_MS = 200;
// WeakMap[Extension -> BrowserAction]
const browserActionMap = new WeakMap();
XPCOMUtils.defineLazyGetter(this, "browserAreas", () => {
ChromeUtils.defineLazyGetter(this, "browserAreas", () => {
return {
navbar: CustomizableUI.AREA_NAVBAR,
menupanel: CustomizableUI.AREA_ADDONS,

Просмотреть файл

@ -32,7 +32,7 @@ const HOMEPAGE_CONFIRMED_TYPE = "homepageNotification";
const HOMEPAGE_SETTING_TYPE = "prefs";
const HOMEPAGE_SETTING_NAME = "homepage_override";
XPCOMUtils.defineLazyGetter(this, "homepagePopup", () => {
ChromeUtils.defineLazyGetter(this, "homepagePopup", () => {
return new ExtensionControlledPopup({
confirmedType: HOMEPAGE_CONFIRMED_TYPE,
observerTopic: "browser-open-homepage-start",

Просмотреть файл

@ -16,7 +16,7 @@ ChromeUtils.defineESModuleGetters(this, {
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "strBundle", function () {
ChromeUtils.defineLazyGetter(this, "strBundle", function () {
return Services.strings.createBundle(
"chrome://global/locale/extensions.properties"
);
@ -28,7 +28,7 @@ const TAB_HIDE_CONFIRMED_TYPE = "tabHideNotification";
const TAB_ID_NONE = -1;
XPCOMUtils.defineLazyGetter(this, "tabHidePopup", () => {
ChromeUtils.defineLazyGetter(this, "tabHidePopup", () => {
return new ExtensionControlledPopup({
confirmedType: TAB_HIDE_CONFIRMED_TYPE,
anchorId: "alltabs-button",

Просмотреть файл

@ -22,7 +22,7 @@ const NEW_TAB_CONFIRMED_TYPE = "newTabNotification";
const NEW_TAB_PRIVATE_ALLOWED = "browser.newtab.privateAllowed";
const NEW_TAB_EXTENSION_CONTROLLED = "browser.newtab.extensionControlled";
XPCOMUtils.defineLazyGetter(this, "newTabPopup", () => {
ChromeUtils.defineLazyGetter(this, "newTabPopup", () => {
return new ExtensionControlledPopup({
confirmedType: NEW_TAB_CONFIRMED_TYPE,
observerTopic: "browser-open-newtab-start",

Просмотреть файл

@ -15,7 +15,7 @@ ChromeUtils.defineESModuleGetters(this, {
loader: "resource://devtools/shared/loader/Loader.sys.mjs",
DevToolsShim: "chrome://devtools-startup/content/DevToolsShim.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "gDevTools", () => {
ChromeUtils.defineLazyGetter(this, "gDevTools", () => {
const { gDevTools } = loader.require("devtools/client/framework/devtools");
return gDevTools;
});

Просмотреть файл

@ -18,7 +18,7 @@ if (!window.IS_STORYBOOK) {
XPCOMUtils = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
).XPCOMUtils;
XPCOMUtils.defineLazyGetter(lazy, "relativeTimeFormat", () => {
ChromeUtils.defineLazyGetter(lazy, "relativeTimeFormat", () => {
return new Services.intl.RelativeTimeFormat(undefined, {
style: "narrow",
});

Просмотреть файл

@ -2,17 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
});
XPCOMUtils.defineLazyGetter(lazy, "relativeTimeFormat", () => {
ChromeUtils.defineLazyGetter(lazy, "relativeTimeFormat", () => {
return new Services.intl.RelativeTimeFormat(undefined, { style: "narrow" });
});

Просмотреть файл

@ -73,7 +73,7 @@ PlacesInsertionPoint.prototype = {
function PlacesController(aView) {
this._view = aView;
XPCOMUtils.defineLazyGetter(this, "profileName", function () {
ChromeUtils.defineLazyGetter(this, "profileName", function () {
return Services.dirsvc.get("ProfD", Ci.nsIFile).leafName;
});

Просмотреть файл

@ -1218,7 +1218,7 @@ var gEditItemOverlay = {
},
};
XPCOMUtils.defineLazyGetter(gEditItemOverlay, "_folderTree", () => {
ChromeUtils.defineLazyGetter(gEditItemOverlay, "_folderTree", () => {
if (!customElements.get("places-tree")) {
Services.scriptloader.loadSubScript(
"chrome://browser/content/places/places-tree.js",
@ -1252,7 +1252,7 @@ for (let elt of [
"tagsField",
]) {
let eltScoped = elt;
XPCOMUtils.defineLazyGetter(gEditItemOverlay, `_${eltScoped}`, () =>
ChromeUtils.defineLazyGetter(gEditItemOverlay, `_${eltScoped}`, () =>
gEditItemOverlay._element(eltScoped)
);
}

Просмотреть файл

@ -2,7 +2,7 @@ ChromeUtils.defineESModuleGetters(this, {
PlacesTestUtils: "resource://testing-common/PlacesTestUtils.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "gFluentStrings", function () {
ChromeUtils.defineLazyGetter(this, "gFluentStrings", function () {
return new Localization(["branding/brand.ftl", "browser/browser.ftl"], true);
});

Просмотреть файл

@ -193,7 +193,7 @@ if (AppConstants.MOZ_UPDATER) {
}
}
XPCOMUtils.defineLazyGetter(this, "gIsPackagedApp", () => {
ChromeUtils.defineLazyGetter(this, "gIsPackagedApp", () => {
return Services.sysinfo.getProperty("isPackagedApp");
});

Просмотреть файл

@ -111,7 +111,7 @@ ChromeUtils.defineESModuleGetters(this, {
UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "gSubDialog", function () {
ChromeUtils.defineLazyGetter(this, "gSubDialog", function () {
const { SubDialogManager } = ChromeUtils.importESModule(
"resource://gre/modules/SubDialog.sys.mjs"
);

Просмотреть файл

@ -49,7 +49,7 @@ const { BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN } = Ci.nsICookieService;
const PASSWORD_MANAGER_PREF_ID = "services.passwordSavingEnabled";
XPCOMUtils.defineLazyGetter(this, "AlertsServiceDND", function () {
ChromeUtils.defineLazyGetter(this, "AlertsServiceDND", function () {
try {
let alertsService = Cc["@mozilla.org/alerts-service;1"]
.getService(Ci.nsIAlertsService)

Просмотреть файл

@ -16,7 +16,7 @@ add_task(async function () {
let win = doc.defaultView;
let dialogURL = "";
let dialogOpened = false;
XPCOMUtils.defineLazyGetter(win, "gSubDialog", () => ({
ChromeUtils.defineLazyGetter(win, "gSubDialog", () => ({
open(aDialogURL, { closingCallback: aCallback }) {
dialogOpened = true;
dialogURL = aDialogURL;

Просмотреть файл

@ -9,7 +9,7 @@ ChromeUtils.defineESModuleGetters(this, {
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
const { QuickSuggestTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/QuickSuggestTestUtils.sys.mjs"
);

Просмотреть файл

@ -7,7 +7,7 @@
"use strict";
XPCOMUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
const { QuickSuggestTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/QuickSuggestTestUtils.sys.mjs"
);

Просмотреть файл

@ -6,7 +6,7 @@ ChromeUtils.defineESModuleGetters(this, {
UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
const { UrlbarTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/UrlbarTestUtils.sys.mjs"
);

Просмотреть файл

@ -18,7 +18,7 @@ XPCOMUtils.defineLazyServiceGetter(
"nsITrackingDBService"
);
XPCOMUtils.defineLazyGetter(this, "DB_PATH", function () {
ChromeUtils.defineLazyGetter(this, "DB_PATH", function () {
return PathUtils.join(PathUtils.profileDir, "protections.sqlite");
});

Просмотреть файл

@ -10,7 +10,7 @@ const { sinon } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, {
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "ExtensionManagement", () => {
ChromeUtils.defineLazyGetter(this, "ExtensionManagement", () => {
const { Management } = ChromeUtils.importESModule(
"resource://gre/modules/Extension.sys.mjs"
);

Просмотреть файл

@ -21,11 +21,11 @@ ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
return module;
});
XPCOMUtils.defineLazyGetter(this, "searchCounts", () => {
ChromeUtils.defineLazyGetter(this, "searchCounts", () => {
return Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
});
XPCOMUtils.defineLazyGetter(this, "SEARCH_AD_CLICK_SCALARS", () => {
ChromeUtils.defineLazyGetter(this, "SEARCH_AD_CLICK_SCALARS", () => {
const sources = [
...BrowserSearchTelemetry.KNOWN_SEARCH_SOURCES.values(),
"unknown",

Просмотреть файл

@ -7,7 +7,7 @@ const { UIState } = ChromeUtils.importESModule(
"resource://services-sync/UIState.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => {
ChromeUtils.defineLazyGetter(this, "fxAccounts", () => {
return ChromeUtils.importESModule(
"resource://gre/modules/FxAccounts.sys.mjs"
).getFxAccountsSingleton();

Просмотреть файл

@ -23,7 +23,7 @@ ChromeUtils.defineESModuleGetters(this, {
UrlbarResult: "resource:///modules/UrlbarResult.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
const { UrlbarTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/UrlbarTestUtils.sys.mjs"
);
@ -31,7 +31,7 @@ XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
return module;
});
XPCOMUtils.defineLazyGetter(this, "SearchTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "SearchTestUtils", () => {
const { SearchTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/SearchTestUtils.sys.mjs"
);

Просмотреть файл

@ -14,7 +14,7 @@ ChromeUtils.defineESModuleGetters(this, {
UrlbarView: "resource:///modules/UrlbarView.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
const { UrlbarTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/UrlbarTestUtils.sys.mjs"
);

Просмотреть файл

@ -12,7 +12,7 @@ const TEST_ENGINE_BASENAME = "searchSuggestionEngine.xml";
let gMaxResults;
let engine;
XPCOMUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
ChromeUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
return UrlbarTestUtils.getOneOffSearchButtons(window);
});

Просмотреть файл

@ -11,7 +11,7 @@ const TEST_ENGINE_BASENAME = "searchSuggestionEngine.xml";
let gMaxResults;
XPCOMUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
ChromeUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
return UrlbarTestUtils.getOneOffSearchButtons(window);
});

Просмотреть файл

@ -8,7 +8,7 @@
"use strict";
XPCOMUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
ChromeUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
return UrlbarTestUtils.getOneOffSearchButtons(window);
});

Просмотреть файл

@ -10,7 +10,7 @@
const TEST_ENGINE_BASENAME = "searchSuggestionEngine.xml";
const SEARCH_STRING = "foo.bar";
XPCOMUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
ChromeUtils.defineLazyGetter(this, "oneOffSearchButtons", () => {
return UrlbarTestUtils.getOneOffSearchButtons(window);
});

Просмотреть файл

@ -10,7 +10,7 @@ ChromeUtils.defineESModuleGetters(this, {
UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "TEST_BASE_URL", () =>
ChromeUtils.defineLazyGetter(this, "TEST_BASE_URL", () =>
getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
"https://example.com"
@ -24,7 +24,7 @@ XPCOMUtils.defineLazyServiceGetter(
"nsIClipboardHelper"
);
XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
const { UrlbarTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/UrlbarTestUtils.sys.mjs"
);
@ -32,7 +32,7 @@ XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
return module;
});
XPCOMUtils.defineLazyGetter(this, "SearchTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "SearchTestUtils", () => {
const { SearchTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/SearchTestUtils.sys.mjs"
);

Просмотреть файл

@ -26,7 +26,7 @@ ChromeUtils.defineESModuleGetters(this, {
sinon: "resource://testing-common/Sinon.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "PlacesFrecencyRecalculator", () => {
ChromeUtils.defineLazyGetter(this, "PlacesFrecencyRecalculator", () => {
return Cc["@mozilla.org/places/frecency-recalculator;1"].getService(
Ci.nsIObserver
).wrappedJSObject;

Просмотреть файл

@ -14,7 +14,7 @@ ChromeUtils.defineESModuleGetters(this, {
const lazy = {};
XPCOMUtils.defineLazyGetter(lazy, "QuickSuggestTestUtils", () => {
ChromeUtils.defineLazyGetter(lazy, "QuickSuggestTestUtils", () => {
const { QuickSuggestTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/QuickSuggestTestUtils.sys.mjs"
);
@ -22,7 +22,7 @@ XPCOMUtils.defineLazyGetter(lazy, "QuickSuggestTestUtils", () => {
return module;
});
XPCOMUtils.defineLazyGetter(this, "MerinoTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "MerinoTestUtils", () => {
const { MerinoTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/MerinoTestUtils.sys.mjs"
);

Просмотреть файл

@ -19,7 +19,7 @@ ChromeUtils.defineESModuleGetters(this, {
UrlbarView: "resource:///modules/UrlbarView.sys.mjs",
});
XPCOMUtils.defineLazyGetter(
ChromeUtils.defineLazyGetter(
this,
"defaultPreferences",
() => new Preferences({ defaultBranch: true })

Просмотреть файл

@ -19,7 +19,7 @@ ChromeUtils.defineESModuleGetters(this, {
"resource:///modules/UrlbarProviderQuickSuggest.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
const { QuickSuggestTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/QuickSuggestTestUtils.sys.mjs"
);
@ -27,7 +27,7 @@ XPCOMUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
return module;
});
XPCOMUtils.defineLazyGetter(this, "MerinoTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "MerinoTestUtils", () => {
const { MerinoTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/MerinoTestUtils.sys.mjs"
);

Просмотреть файл

@ -98,7 +98,7 @@ const EXPECTED_MERINO_URLBAR_RESULT = {
// `UrlbarProviderQuickSuggest.#merino` is lazily created on the first Merino
// fetch, so it's easiest to create `gClient` lazily too.
XPCOMUtils.defineLazyGetter(
ChromeUtils.defineLazyGetter(
this,
"gClient",
() => UrlbarProviderQuickSuggest._test_merino

Просмотреть файл

@ -8,7 +8,7 @@
// `UrlbarProviderQuickSuggest.#merino` is lazily created on the first Merino
// fetch, so it's easiest to create `gClient` lazily too.
XPCOMUtils.defineLazyGetter(
ChromeUtils.defineLazyGetter(
this,
"gClient",
() => UrlbarProviderQuickSuggest._test_merino

Просмотреть файл

@ -29,7 +29,7 @@ ChromeUtils.defineESModuleGetters(this, {
sinon: "resource://testing-common/Sinon.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
const { QuickSuggestTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/QuickSuggestTestUtils.sys.mjs"
);
@ -37,7 +37,7 @@ XPCOMUtils.defineLazyGetter(this, "QuickSuggestTestUtils", () => {
return module;
});
XPCOMUtils.defineLazyGetter(this, "MerinoTestUtils", () => {
ChromeUtils.defineLazyGetter(this, "MerinoTestUtils", () => {
const { MerinoTestUtils: module } = ChromeUtils.importESModule(
"resource://testing-common/MerinoTestUtils.sys.mjs"
);
@ -53,7 +53,7 @@ ChromeUtils.defineLazyGetter(this, "UrlbarTestUtils", () => {
return module;
});
XPCOMUtils.defineLazyGetter(this, "PlacesFrecencyRecalculator", () => {
ChromeUtils.defineLazyGetter(this, "PlacesFrecencyRecalculator", () => {
return Cc["@mozilla.org/places/frecency-recalculator;1"].getService(
Ci.nsIObserver
).wrappedJSObject;

Просмотреть файл

@ -9,7 +9,7 @@
// Other existing autofill tests will, of course, need to be adapted once an
// algorithm is promoted to be the default.
XPCOMUtils.defineLazyGetter(this, "PlacesFrecencyRecalculator", () => {
ChromeUtils.defineLazyGetter(this, "PlacesFrecencyRecalculator", () => {
return Cc["@mozilla.org/places/frecency-recalculator;1"].getService(
Ci.nsIObserver
).wrappedJSObject;

Просмотреть файл

@ -13,9 +13,6 @@ const EDIT_CREDIT_CARD_URL =
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { FormAutofill } = ChromeUtils.importESModule(
"resource://autofill/FormAutofill.sys.mjs"
);
@ -31,7 +28,7 @@ ChromeUtils.defineESModuleGetters(this, {
});
const lazy = {};
XPCOMUtils.defineLazyGetter(
ChromeUtils.defineLazyGetter(
lazy,
"l10n",
() =>
@ -42,7 +39,7 @@ XPCOMUtils.defineLazyGetter(
);
this.log = null;
XPCOMUtils.defineLazyGetter(this, "log", () =>
ChromeUtils.defineLazyGetter(this, "log", () =>
FormAutofill.defineLogGetter(this, "manageAddresses")
);

Просмотреть файл

@ -4,9 +4,9 @@
"use strict";
/* global ExtensionAPI, Services, XPCOMUtils */
/* global ExtensionAPI, Services */
XPCOMUtils.defineLazyGetter(this, "l10nStrings", function () {
ChromeUtils.defineLazyGetter(this, "l10nStrings", function () {
return Services.strings.createBundle(
"chrome://report-site-issue/locale/webcompat.properties"
);

Просмотреть файл

@ -21,7 +21,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
// eslint-disable-next-line mozilla/reject-importGlobalProperties
XPCOMUtils.defineLazyGlobalGetters(this, ["ChannelWrapper"]);
XPCOMUtils.defineLazyGetter(this, "searchInitialized", () => {
ChromeUtils.defineLazyGetter(this, "searchInitialized", () => {
if (Services.search.isInitialized) {
return Promise.resolve();
}

Просмотреть файл

@ -49,7 +49,7 @@ XPCOMUtils.defineLazyScriptGetter(
"FullScreen",
"chrome://fxr/content/fxr-fullScreen.js"
);
XPCOMUtils.defineLazyGetter(this, "gSystemPrincipal", () =>
ChromeUtils.defineLazyGetter(this, "gSystemPrincipal", () =>
Services.scriptSecurityManager.getSystemPrincipal()
);

Просмотреть файл

@ -38,7 +38,7 @@ let tracker, releaseTrackerLoader;
// => Avoid loading devtools module as much as possible
// => If you really have to, lazy load them
XPCOMUtils.defineLazyGetter(this, "TrackedObjects", () => {
ChromeUtils.defineLazyGetter(this, "TrackedObjects", () => {
return ChromeUtils.importESModule(
"resource://devtools/shared/test-helpers/tracked-objects.sys.mjs"
);

Просмотреть файл

@ -3,7 +3,7 @@
"use strict";
XPCOMUtils.defineLazyGetter(this, "jsonViewStrings", () => {
ChromeUtils.defineLazyGetter(this, "jsonViewStrings", () => {
return Services.strings.createBundle(
"chrome://devtools/locale/jsonview.properties"
);

Просмотреть файл

@ -4,11 +4,7 @@
"use strict";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "ZipWriter", function () {
ChromeUtils.defineLazyGetter(this, "ZipWriter", function () {
return Components.Constructor("@mozilla.org/zipwriter;1", "nsIZipWriter");
});

Просмотреть файл

@ -4,9 +4,6 @@
"use strict";
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var EventEmitter = require("resource://devtools/shared/event-emitter.js");
var { StyleEditorUI } = ChromeUtils.importESModule(
@ -164,8 +161,12 @@ StyleEditorPanel.prototype = {
},
};
XPCOMUtils.defineLazyGetter(StyleEditorPanel.prototype, "strings", function () {
return Services.strings.createBundle(
"chrome://devtools/locale/styleeditor.properties"
);
});
ChromeUtils.defineLazyGetter(
StyleEditorPanel.prototype,
"strings",
function () {
return Services.strings.createBundle(
"chrome://devtools/locale/styleeditor.properties"
);
}
);

Просмотреть файл

@ -9,7 +9,7 @@ const { HttpServer } = ChromeUtils.importESModule(
var httpServer = null;
XPCOMUtils.defineLazyGetter(this, "serverPort", function () {
ChromeUtils.defineLazyGetter(this, "serverPort", function () {
return httpServer.identity.primaryPort;
});

Просмотреть файл

@ -9,7 +9,7 @@ const { HttpServer } = ChromeUtils.importESModule(
var httpServer = null;
XPCOMUtils.defineLazyGetter(this, "serverPort", function () {
ChromeUtils.defineLazyGetter(this, "serverPort", function () {
return httpServer.identity.primaryPort;
});

Просмотреть файл

@ -9,7 +9,7 @@ const { HttpServer } = ChromeUtils.importESModule(
var httpServer = null;
XPCOMUtils.defineLazyGetter(this, "serverPort", function () {
ChromeUtils.defineLazyGetter(this, "serverPort", function () {
return httpServer.identity.primaryPort;
});

Просмотреть файл

@ -9,7 +9,7 @@ const { HttpServer } = ChromeUtils.importESModule(
var httpServer = null;
XPCOMUtils.defineLazyGetter(this, "serverPort", function () {
ChromeUtils.defineLazyGetter(this, "serverPort", function () {
return httpServer.identity.primaryPort;
});

Просмотреть файл

@ -4,16 +4,13 @@ const { HttpServer } = ChromeUtils.importESModule(
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
// Since this test creates a TYPE_DOCUMENT channel via javascript, it will
// end up using the wrong LoadInfo constructor. Setting this pref will disable
// the ContentPolicyType assertion in the constructor.
Services.prefs.setBoolPref("network.loadinfo.skip_type_assertion", true);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpserver.identity.primaryPort;
});

Просмотреть файл

@ -4,11 +4,8 @@ const { HttpServer } = ChromeUtils.importESModule(
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "HTTP_TEST_URL", function () {
ChromeUtils.defineLazyGetter(this, "HTTP_TEST_URL", function () {
return "http://test1.example.com";
});

Просмотреть файл

@ -4,15 +4,11 @@
*/
/* import-globals-from async_load_tests.js */
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var ioService = Services.io;
// This is used in async_load_tests.js
// eslint-disable-next-line no-unused-vars
XPCOMUtils.defineLazyGetter(this, "uri", function () {
ChromeUtils.defineLazyGetter(this, "uri", function () {
return ioService.newURI(
"http://localhost:" +
server.identity.primaryPort +

Просмотреть файл

@ -25,7 +25,7 @@ ChromeUtils.defineESModuleGetters(this, {
SafeBrowsing: "resource://gre/modules/SafeBrowsing.sys.mjs",
});
XPCOMUtils.defineLazyGetter(this, "WindowEventDispatcher", () =>
ChromeUtils.defineLazyGetter(this, "WindowEventDispatcher", () =>
EventDispatcher.for(window)
);

Просмотреть файл

@ -8,11 +8,11 @@
* Basic functionality test, from the client programmer's POV.
*/
XPCOMUtils.defineLazyGetter(this, "port", function () {
ChromeUtils.defineLazyGetter(this, "port", function () {
return srv.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
"http://localhost:" + port + "/objHandler",

Просмотреть файл

@ -41,7 +41,7 @@ function contentLength(request, response) {
* BEGIN TESTS *
***************/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
"http://localhost:" + srv.identity.primaryPort + "/content-length",

Просмотреть файл

@ -8,11 +8,11 @@
// correct data.
var srv;
XPCOMUtils.defineLazyGetter(this, "PREFIX", function () {
ChromeUtils.defineLazyGetter(this, "PREFIX", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
PREFIX + "/range.txt",

Просмотреть файл

@ -7,11 +7,11 @@
// exercises support for mod_cern_meta-style header/status line modification
var srv;
XPCOMUtils.defineLazyGetter(this, "PREFIX", function () {
ChromeUtils.defineLazyGetter(this, "PREFIX", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(PREFIX + "/test_both.html", null, start_testBoth, null),
new Test(

Просмотреть файл

@ -10,7 +10,7 @@
var srv, dir, gDirEntries;
XPCOMUtils.defineLazyGetter(this, "BASE_URL", function () {
ChromeUtils.defineLazyGetter(this, "BASE_URL", function () {
return "http://localhost:" + srv.identity.primaryPort + "/";
});
@ -216,7 +216,7 @@ function makeFile(name, isDirectory, parentDir, lst) {
* TESTS *
*********/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(BASE_URL, null, start, stopRootDirectory),
new Test(BASE_URL + "foo/", null, start, stopFooDirectory),

Просмотреть файл

@ -9,7 +9,7 @@
var srv;
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
"http://localhost:" + srv.identity.primaryPort + "/empty-body-unwritten",

Просмотреть файл

@ -7,7 +7,7 @@
// Request handlers may throw exceptions, and those exception should be caught
// by the server and converted into the proper error codes.
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
"http://localhost:" + srv.identity.primaryPort + "/throws/exception",

Просмотреть файл

@ -44,7 +44,7 @@ function pathHandler(request, response) {
* BEGIN TESTS *
***************/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
"http://localhost:" + srv.identity.primaryPort + "/path-handler",

Просмотреть файл

@ -10,11 +10,11 @@
var srv;
XPCOMUtils.defineLazyGetter(this, "PREFIX", function () {
ChromeUtils.defineLazyGetter(this, "PREFIX", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(PREFIX + "/bar.html^", null, start_bar_html_, null),
new Test(PREFIX + "/foo.html^", null, start_foo_html_, null),

Просмотреть файл

@ -8,7 +8,7 @@
* Tests for correct behavior of asynchronous responses.
*/
XPCOMUtils.defineLazyGetter(this, "PREPATH", function () {
ChromeUtils.defineLazyGetter(this, "PREPATH", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
@ -28,7 +28,7 @@ function run_test() {
* BEGIN TESTS *
***************/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(PREPATH + "/handleSync", null, start_handleSync, null),
new Test(

Просмотреть файл

@ -11,7 +11,7 @@
* created by XPConnect.
*/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
"http://localhost:" + srv.identity.primaryPort + "/test",

Просмотреть файл

@ -6,7 +6,7 @@
// tests the registerDirectory API
XPCOMUtils.defineLazyGetter(this, "BASE", function () {
ChromeUtils.defineLazyGetter(this, "BASE", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
@ -47,7 +47,7 @@ function checkFile(ch, status, data) {
);
}
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
/** *********************
* without a base path *

Просмотреть файл

@ -6,7 +6,7 @@
// tests the registerFile API
XPCOMUtils.defineLazyGetter(this, "BASE", function () {
ChromeUtils.defineLazyGetter(this, "BASE", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
@ -21,7 +21,7 @@ function onStop(ch, status, data) {
Assert.equal(data.length, file.fileSize);
}
XPCOMUtils.defineLazyGetter(this, "test", function () {
ChromeUtils.defineLazyGetter(this, "test", function () {
return new Test(BASE + "/foo", null, onStart, onStop);
});

Просмотреть файл

@ -6,7 +6,7 @@
// tests the registerPrefixHandler API
XPCOMUtils.defineLazyGetter(this, "BASE", function () {
ChromeUtils.defineLazyGetter(this, "BASE", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
@ -28,7 +28,7 @@ function makeCheckOverride(magic) {
};
}
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
BASE + "/prefix/dummy",

Просмотреть файл

@ -6,7 +6,7 @@
// make sure response.write works for strings, and coerces other args to strings
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
"http://localhost:" + srv.identity.primaryPort + "/writeString",

Просмотреть файл

@ -8,7 +8,7 @@
* Tests that the seizePower API works correctly.
*/
XPCOMUtils.defineLazyGetter(this, "PORT", function () {
ChromeUtils.defineLazyGetter(this, "PORT", function () {
return srv.identity.primaryPort;
});
@ -136,7 +136,7 @@ function handleSeizeAfterAsync(request, response) {
* BEGIN TESTS *
***************/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new RawTest("localhost", PORT, data0, checkRawData),
new RawTest("localhost", PORT, data1, checkTooLate),

Просмотреть файл

@ -18,11 +18,11 @@ function run_test() {
runHttpTests(tests, testComplete(srv));
}
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + srv.identity.primaryPort + "/";
});
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(URL, init, startCustomIndexHandler, stopCustomIndexHandler),
new Test(URL, init, startDefaultIndexHandler, stopDefaultIndexHandler),

Просмотреть файл

@ -7,7 +7,7 @@
// exercise nsIHttpResponse.setStatusLine, ensure its atomicity, and ensure the
// specified behavior occurs if it's not called
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
@ -55,7 +55,7 @@ function checkStatusLine(
* TESTS *
*********/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(URL + "/no/setstatusline", null, startNoSetStatusLine, stop),
new Test(URL + "/http1_0", null, startHttp1_0, stop),

Просмотреть файл

@ -8,7 +8,7 @@
* Tests that the object-state-preservation mechanism works correctly.
*/
XPCOMUtils.defineLazyGetter(this, "PATH", function () {
ChromeUtils.defineLazyGetter(this, "PATH", function () {
return "http://localhost:" + srv.identity.primaryPort + "/object-state.sjs";
});

Просмотреть файл

@ -6,7 +6,7 @@
// exercises the server's state-preservation API
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
@ -78,7 +78,7 @@ function pathHandler(request, response) {
* BEGIN TESTS *
***************/
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
return [
new Test(
// eslint-disable-next-line no-useless-concat

Просмотреть файл

@ -10,7 +10,7 @@
* then preventing any file from being opened).
*/
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + srv.identity.primaryPort;
});
@ -45,7 +45,7 @@ var lastPassed = false;
// This hits the open-file limit for me on OS X; your mileage may vary.
const TEST_RUNS = 250;
XPCOMUtils.defineLazyGetter(this, "tests", function () {
ChromeUtils.defineLazyGetter(this, "tests", function () {
var _tests = new Array(TEST_RUNS + 1);
var _test = new Test(URL + "/thrower.sjs?throw", null, start_thrower);
for (var i = 0; i < TEST_RUNS; i++) {

Просмотреть файл

@ -8,11 +8,11 @@
* Tests for correct behavior of the server start() and stop() methods.
*/
XPCOMUtils.defineLazyGetter(this, "PORT", function () {
ChromeUtils.defineLazyGetter(this, "PORT", function () {
return srv.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "PREPATH", function () {
ChromeUtils.defineLazyGetter(this, "PREPATH", function () {
return "http://localhost:" + PORT;
});

Просмотреть файл

@ -8,11 +8,11 @@
* Tests for correct behavior of the server start_ipv6() and stop() methods.
*/
XPCOMUtils.defineLazyGetter(this, "PORT", function () {
ChromeUtils.defineLazyGetter(this, "PORT", function () {
return srv.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "PREPATH", function () {
ChromeUtils.defineLazyGetter(this, "PREPATH", function () {
return "http://localhost:" + PORT;
});

Просмотреть файл

@ -4,7 +4,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return `http://localhost:${httpServer.identity.primaryPort}/test`;
});

Просмотреть файл

@ -5,7 +5,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpServer.identity.primaryPort;
});
@ -13,7 +13,7 @@ var httpServer = null;
const testFileName = "test_customConditionalRequest_304";
const basePath = "/" + testFileName + "/";
XPCOMUtils.defineLazyGetter(this, "baseURI", function () {
ChromeUtils.defineLazyGetter(this, "baseURI", function () {
return URL + basePath;
});

Просмотреть файл

@ -4,15 +4,15 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpserver.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "uri", function () {
ChromeUtils.defineLazyGetter(this, "uri", function () {
return URL + "/redirect";
});
XPCOMUtils.defineLazyGetter(this, "noRedirectURI", function () {
ChromeUtils.defineLazyGetter(this, "noRedirectURI", function () {
return URL + "/content";
});

Просмотреть файл

@ -4,7 +4,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpserver.identity.primaryPort;
});

Просмотреть файл

@ -21,7 +21,7 @@ var httpProtocolHandler = Cc[
"@mozilla.org/network/protocol;1?name=http"
].getService(Ci.nsIHttpProtocolHandler);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://foo@localhost:" + httpServer.identity.primaryPort;
});

Просмотреть файл

@ -19,10 +19,10 @@ var sRedirectPromptPref;
const BUGID = "676059";
const OTHERBUGID = "696849";
XPCOMUtils.defineLazyGetter(this, "pSame", function () {
ChromeUtils.defineLazyGetter(this, "pSame", function () {
return sSame.identity.primaryPort;
});
XPCOMUtils.defineLazyGetter(this, "pOther", function () {
ChromeUtils.defineLazyGetter(this, "pOther", function () {
return sOther.identity.primaryPort;
});

Просмотреть файл

@ -16,7 +16,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpServer.identity.primaryPort + "/content";
});

Просмотреть файл

@ -15,7 +15,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpServer.identity.primaryPort + "/content";
});

Просмотреть файл

@ -18,7 +18,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpServer.identity.primaryPort + "/content";
});

Просмотреть файл

@ -15,7 +15,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpServer.identity.primaryPort + "/content";
});

Просмотреть файл

@ -17,7 +17,7 @@ const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
XPCOMUtils.defineLazyGetter(this, "URL", function () {
ChromeUtils.defineLazyGetter(this, "URL", function () {
return "http://localhost:" + httpServer.identity.primaryPort + "/content";
});

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше