Bug 1667455 - Part 10: Stop importing Services.jsm from chrome-priv HTML code, multi-line cases. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D150899
This commit is contained in:
Tooru Fujisawa 2022-07-11 12:41:53 +00:00
Родитель 52c95734e7
Коммит 03b55aae15
9 изменённых файлов: 0 добавлений и 31 удалений

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

@ -24,9 +24,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1339722
* 4. Verify that it doesn't crash.
**/
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
// This topic used to be http-on-useragent-request, but that got removed in
// bug 1513574. on-modify-request is called around the same time, and should
// behave similarly.

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

@ -15,10 +15,6 @@
var chromeScript;
chromeScript = SpecialPowers.loadChromeScript(_ => {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
});

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

@ -18,9 +18,6 @@
"resource://gre/modules/AppConstants.jsm"
);
const { Assert } = ChromeUtils.import("resource://testing-common/Assert.jsm");
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const UNRECOGNIZED_PATH = /Could not initialize path: NS_ERROR_FILE_UNRECOGNIZED_PATH/;
const EMPTY_PATH = /PathUtils does not support empty paths/;

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

@ -58,9 +58,6 @@ let chromeScriptHandle = null;
function startListeningForClickEventsInChrome() {
/* eslint-env mozilla/frame-script */
function chromeScript() {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
let topWin = Services.wm.getMostRecentWindow("navigator:browser");
if (!topWin) {
topWin = Services.wm.getMostRecentWindow("navigator:geckoview");

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

@ -38,9 +38,6 @@ let chromeScriptHandle = null;
function startListeningForContextmenuEventsInChrome() {
/* eslint-env mozilla/frame-script */
function chromeScript() {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
let topWin = Services.wm.getMostRecentWindow("navigator:browser");
if (!topWin) {
topWin = Services.wm.getMostRecentWindow("navigator:geckoview");

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

@ -41,9 +41,6 @@ add_task(async function check_startup_canary() {
async function canaryExists() {
let chromeScript = loadChromeScript(async () => {
const {
Services,
} = ChromeUtils.import("resource://gre/modules/Services.jsm");
// This file is called FILE_STARTUP_INCOMPLETE in nsAppRunner.cpp and
// referenced via mozilla::startup::GetIncompleteStartupFile:
let file = Services.dirsvc.get("ProfLD", Ci.nsIFile);

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

@ -25,11 +25,6 @@ function addLoginsInParent(...aLogins) {
let initialCount = 5;
addMessageListener("initLogins", logins => {
// eslint-disable-next-line no-shadow
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
let nsLoginInfo = Components.Constructor(
"@mozilla.org/login-manager/loginInfo;1",
Ci.nsILoginInfo,

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

@ -35,9 +35,6 @@ let proxyAuthinfo = {
modalType = authPromptModalType;
let chromeScript = runInParent(() => {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const promptFac = Cc[
"@mozilla.org/passwordmanager/authpromptfactory;1"
].getService(Ci.nsIPromptFactory);

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

@ -14,10 +14,6 @@ async function runTests() {
var chromeScript;
chromeScript = SpecialPowers.loadChromeScript(_ => {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
function onExamResp(subject, topic, data) {
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
let classifiedChannel = subject.QueryInterface(Ci.nsIClassifiedChannel);