mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1819960 - Convert consumers of netwerk/ to import ES modules directly. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D171490
This commit is contained in:
parent
6c4b226572
commit
30ec141b24
@ -41,6 +41,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
||||
PublicSuffixList:
|
||||
"resource://gre/modules/netwerk-dns/PublicSuffixList.sys.mjs",
|
||||
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
|
||||
|
||||
RemoteSecuritySettings:
|
||||
@ -93,7 +95,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
PdfJs: "resource://pdf.js/PdfJs.jsm",
|
||||
PluralForm: "resource://gre/modules/PluralForm.jsm",
|
||||
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
|
||||
PublicSuffixList: "resource://gre/modules/netwerk-dns/PublicSuffixList.jsm",
|
||||
RFPHelper: "resource://gre/modules/RFPHelper.jsm",
|
||||
SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
|
||||
Sanitizer: "resource:///modules/Sanitizer.jsm",
|
||||
|
@ -2,8 +2,8 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
@ -1,6 +1,6 @@
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
@ -2,8 +2,8 @@ const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
const BASE_HOST = "example.org";
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
@ -4,8 +4,8 @@ function inChildProcess() {
|
||||
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
|
||||
}
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
let CookieXPCShellUtilsInitialized = false;
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { PublicSuffixList } = ChromeUtils.import(
|
||||
"resource://gre/modules/netwerk-dns/PublicSuffixList.jsm"
|
||||
const { PublicSuffixList } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/netwerk-dns/PublicSuffixList.sys.mjs"
|
||||
);
|
||||
const { TestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TestUtils.sys.mjs"
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
Services.prefs.setBoolPref("network.early-hints.enabled", true);
|
||||
|
||||
const { request_count_checking } = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
const { request_count_checking } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// - testName is just there to be printed during Asserts when failing
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
Services.prefs.setBoolPref("network.early-hints.enabled", true);
|
||||
|
||||
const { test_preload_hint_and_request } = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
const { test_preload_hint_and_request } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_preload_images_csp_in_early_hints_response() {
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
Services.prefs.setBoolPref("network.early-hints.enabled", true);
|
||||
|
||||
const { test_preload_hint_and_request } = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
const { test_preload_hint_and_request } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
add_task(async function test_preload_styles_csp_in_response() {
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
Services.prefs.setBoolPref("network.early-hints.enabled", true);
|
||||
|
||||
const { test_hint_preload } = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
const { test_hint_preload } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// 400 Bad Request
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
Services.prefs.setBoolPref("network.early-hints.enabled", true);
|
||||
|
||||
const { request_count_checking } = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
const { request_count_checking } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// - httpCode is the response code we're testing for. This file mostly covers 400 and 500 responses
|
||||
|
@ -15,8 +15,8 @@ const {
|
||||
request_count_checking,
|
||||
test_hint_preload_internal,
|
||||
test_hint_preload,
|
||||
} = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// TODO testing:
|
||||
|
@ -10,8 +10,8 @@ const {
|
||||
test_hint_preload,
|
||||
test_hint_preload_internal,
|
||||
request_count_checking,
|
||||
} = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// two early hint responses
|
||||
|
@ -6,8 +6,11 @@
|
||||
|
||||
Services.prefs.setBoolPref("network.early-hints.enabled", true);
|
||||
|
||||
const { test_hint_preload, request_count_checking } = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
const {
|
||||
test_hint_preload,
|
||||
request_count_checking,
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// Early hint to redirect to same origin in secure context
|
||||
|
@ -11,8 +11,8 @@ const {
|
||||
request_count_checking,
|
||||
test_hint_preload_internal,
|
||||
test_hint_preload,
|
||||
} = ChromeUtils.import(
|
||||
"resource://testing-common/early_hint_preload_test_helper.jsm"
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/early_hint_preload_test_helper.sys.mjs"
|
||||
);
|
||||
|
||||
const START_VALUE =
|
||||
|
@ -16,7 +16,9 @@ const {
|
||||
fetchHelper,
|
||||
preclean_test,
|
||||
cleanup_test,
|
||||
} = ChromeUtils.import("resource://testing-common/cookie_filtering_helper.jsm");
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/cookie_filtering_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// run suite with content listener
|
||||
// 1. initializes the content process and observer
|
||||
|
@ -14,7 +14,9 @@ const {
|
||||
checkExpectedCookies,
|
||||
preclean_test,
|
||||
cleanup_test,
|
||||
} = ChromeUtils.import("resource://testing-common/cookie_filtering_helper.jsm");
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/cookie_filtering_helper.sys.mjs"
|
||||
);
|
||||
|
||||
async function runSuiteWithContentListener(name, trigger_suite_func, expected) {
|
||||
return async function(browser) {
|
||||
|
@ -15,7 +15,9 @@ const {
|
||||
fetchHelper,
|
||||
preclean_test,
|
||||
cleanup_test,
|
||||
} = ChromeUtils.import("resource://testing-common/cookie_filtering_helper.jsm");
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/cookie_filtering_helper.sys.mjs"
|
||||
);
|
||||
|
||||
async function runSuiteWithContentListener(name, trigger_suite_func, expected) {
|
||||
return async function(browser) {
|
||||
|
@ -17,7 +17,9 @@ const {
|
||||
triggerSetCookieFromHttpPrivate,
|
||||
preclean_test,
|
||||
cleanup_test,
|
||||
} = ChromeUtils.import("resource://testing-common/cookie_filtering_helper.jsm");
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/cookie_filtering_helper.sys.mjs"
|
||||
);
|
||||
|
||||
// TEST: OriginAttributes
|
||||
// * example.com OA-changed cookies don't go to example.com & vice-versa
|
||||
|
@ -16,7 +16,9 @@ const {
|
||||
fetchHelper,
|
||||
preclean_test,
|
||||
cleanup_test,
|
||||
} = ChromeUtils.import("resource://testing-common/cookie_filtering_helper.jsm");
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/cookie_filtering_helper.sys.mjs"
|
||||
);
|
||||
|
||||
const HTTPS_SUBDOMAIN_1_EXAMPLE_COM = "https://test1.example.com";
|
||||
const HTTP_SUBDOMAIN_1_EXAMPLE_COM = "http://test1.example.com";
|
||||
|
@ -7,8 +7,8 @@
|
||||
"use strict";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
// Don't pick up default permissions from profile.
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
@ -2,8 +2,8 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
@ -2,8 +2,8 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
// Small red image.
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
let gHints = 0;
|
||||
|
@ -2,8 +2,8 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const { CookieXPCShellUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/CookieXPCShellUtils.jsm"
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
||||
CookieXPCShellUtils.init(this);
|
||||
|
Loading…
Reference in New Issue
Block a user