Backed out 2 changesets (bug 1834176) for causing xpc failures in test_unload.js CLOSED TREE

Backed out changeset 57876d77a652 (bug 1834176)
Backed out changeset ae2f0837b528 (bug 1834176)
This commit is contained in:
Noemi Erli 2023-05-23 12:14:37 +03:00
Родитель 61ed1c4c8c
Коммит aa2f146d78
157 изменённых файлов: 332 добавлений и 392 удалений

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

@ -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",
@ -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",

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

@ -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 = {
/**

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

@ -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",
@ -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",

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

@ -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"
);

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

@ -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",
});

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

@ -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",
});
/**

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

@ -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"

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

@ -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);

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

@ -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",
});
@ -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",
});

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

@ -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";
@ -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.

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

@ -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"
);

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

@ -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",

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

@ -1,9 +1,12 @@
/* 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",
@ -11,6 +14,10 @@ ChromeUtils.defineESModuleGetters(this, {
sinon: "resource://testing-common/Sinon.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});
const TEST_PROVIDER_INFO = [
{
telemetryId: "example",

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

@ -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);

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

@ -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"
);

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

@ -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"];

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

@ -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(

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

@ -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");
});

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

@ -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");

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

@ -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",

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

@ -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,

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

@ -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",
});

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

@ -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.

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

@ -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;
});
/**

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

@ -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,
@ -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,

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

@ -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",

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

@ -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) {

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

@ -2,7 +2,7 @@
* 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/. */
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
/**
* A function that can be used as part of a require hook for a

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

@ -67,8 +67,10 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
DevToolsInfaillibleUtils:
"resource://devtools/shared/DevToolsInfaillibleUtils.sys.mjs",
});
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
XPCOMUtils.defineLazyModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});
// It would make sense to put this in the above

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

@ -8,7 +8,7 @@
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const lazy = {};

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

@ -2,16 +2,21 @@
* 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/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
getResponseCacheObject:
"resource://devtools/shared/platform/CacheEntry.sys.mjs",
NetworkHelper:
"resource://devtools/shared/network-observer/NetworkHelper.sys.mjs",
NetworkUtils:
"resource://devtools/shared/network-observer/NetworkUtils.sys.mjs",
getResponseCacheObject:
"resource://devtools/shared/platform/CacheEntry.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});
// Network logging

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

@ -12,9 +12,7 @@ var CC = Components.Constructor;
const { require } = ChromeUtils.importESModule(
"resource://devtools/shared/loader/Loader.sys.mjs"
);
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// We do not want to log packets by default, because in some tests,
// we can be sending large amounts of data. The test harness has

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

@ -7,7 +7,6 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
);
ChromeUtils.defineESModuleGetters(this, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs",
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
@ -16,6 +15,7 @@ ChromeUtils.defineESModuleGetters(this, {
XPCOMUtils.defineLazyModuleGetters(this, {
AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm",
HttpServer: "resource://testing-common/httpd.js",
NetUtil: "resource://gre/modules/NetUtil.jsm",
});
var profileDir = do_get_profile();

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

@ -30,9 +30,7 @@ var {
HttpError,
HttpServer,
} = ChromeUtils.import("resource://testing-common/httpd.js");
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const nsIDocumentEncoder = Ci.nsIDocumentEncoder;
const replacementChar =

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

@ -11,9 +11,7 @@ var docbody =
'<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>';
function handler(metadata, response) {
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
let body = NetUtil.readInputStreamToString(
metadata.bodyInputStream,

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

@ -1,7 +1,5 @@
"use strict";
let { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
let { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function handleRequest(request, response) {
response.setStatusLine(request.httpVersion, 200);

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

@ -1,7 +1,5 @@
"use strict";
let { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
let { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
Cu.importGlobalProperties(["URLSearchParams"]);
function loadHTMLFromFile(path) {

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

@ -2,7 +2,7 @@
* 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/. */
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
/** This little class ensures that redirects maintain an https:// origin */
function RedirectHttpsOnly() {}

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

@ -6,7 +6,7 @@ import { PushDB } from "resource://gre/modules/PushDB.sys.mjs";
import { PushRecord } from "resource://gre/modules/PushRecord.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
import { clearTimeout, setTimeout } from "resource://gre/modules/Timer.sys.mjs";
import { PushCrypto } from "resource://gre/modules/PushCrypto.sys.mjs";

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// Returns the test H/2 server port, throwing if it's missing or invalid.
function getTestServerPort() {

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

@ -1,8 +1,6 @@
// SJS file for CSP mochitests
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function loadHTMLFromFile(path) {
// Load the HTML to return in the response from file.

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

@ -1,8 +1,6 @@
// Server side js file for bug 910139, see file test_bug910139.html for details.
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function loadResponseFromFile(path) {
var testHTMLFile = Components.classes["@mozilla.org/file/directory_service;1"]

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

@ -2,9 +2,7 @@
// * Bug 1004703 - ignore 'unsafe-inline' if nonce- or hash-source specified
// * Bug 1198422: should not block inline script if default-src is not specified
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function loadHTMLFromFile(path) {
// Load the HTML to return in the response from file.

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

@ -1,8 +1,6 @@
/* eslint-env mozilla/chrome-script */
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
Cu.importGlobalProperties(["TextDecoder"]);

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

@ -1,8 +1,6 @@
// SJS file for CSP mochitests
"use strict";
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
Components.utils.importGlobalProperties(["URLSearchParams"]);
function loadHTMLFromFile(path) {

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

@ -1,9 +1,7 @@
// Custom *.sjs specifically for the needs of Bug
// Bug 1139297 - Implement CSP upgrade-insecure-requests directive
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// small red image
const IMG_BYTES = atob(

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function ERR(response, msg) {
dump("ERROR: " + msg + "\n");

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

@ -2,9 +2,7 @@
* 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 { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
var httpServer = new HttpServer();

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

@ -1,7 +1,5 @@
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);

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

@ -1,7 +1,5 @@
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const TEST_PATH = "/https_only_https_first_port";
var httpserver = null;

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

@ -1,7 +1,5 @@
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);

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

@ -6,9 +6,7 @@
* <https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy>.
*/
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
Services.prefs.setCharPref(
"dom.securecontext.allowlist",

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

@ -13,9 +13,7 @@ registerCleanupFunction(async () => {
Services.prefs.clearUserPref("network.dns.localDomains");
});
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function readFile(file) {
let fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(

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

@ -22,9 +22,7 @@ registerCleanupFunction(async () => {
Services.prefs.clearUserPref("network.webtransport.redirect.enabled");
});
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function readFile(file) {
let fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(

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

@ -21,9 +21,7 @@ registerCleanupFunction(async () => {
Services.prefs.clearUserPref("network.webtransport.redirect.enabled");
});
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function readFile(file) {
let fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(

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

@ -12,9 +12,7 @@ const nsIFilePicker = Ci.nsIFilePicker;
const STDURLMUT_CTRID = "@mozilla.org/network/standard-url-mutator;1";
const nsIURIMutator = Ci.nsIURIMutator;
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var gStop = false;

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

@ -2,9 +2,7 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// Helper to step a generator function and catch a StopIteration exception.
function do_run_generator(generator) {

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

@ -8,9 +8,7 @@
/* import-globals-from image_load_helpers.js */
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const ReferrerInfo = Components.Constructor(
"@mozilla.org/referrer-info;1",
"nsIReferrerInfo",

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

@ -2,9 +2,7 @@
* Tests for imgITools
*/
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
/*
* dumpToFile()

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
const ReferrerInfo = Components.Constructor(

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

@ -9,9 +9,7 @@
* UTF16 character and mid-surrogate pair
*/
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const test = [
// 0: Valid surrogate pair

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

@ -11,9 +11,7 @@
* is an eight-bit character.
*/
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const beBOM = "%FE%FF";
const leBOM = "%FF%FE";

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

@ -4,9 +4,7 @@
*
*/
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const test = [
// 0: 0x8e followed by hi byte, not valid JIS X 0201

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

@ -2,9 +2,7 @@
var Cc = Components.Constructor;
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const tests = [
{

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

@ -1,4 +1,3 @@
/* global base */
var ns = {};
Services.scriptloader.loadSubScript(base + "file_expandosharing.jsm", ns);
var checkFromJSM = ns.checkFromJSM;
Services.scriptloader.loadSubScript("resource://gre/modules/NetUtil.jsm", ns);
var NetUtil = ns.NetUtil;

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

@ -15,8 +15,6 @@
<script type="application/javascript" src="outoflinexulscript.js"></script>
<script type="application/javascript"><![CDATA[
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
let base = /.*\//.exec(window.location.href)[0];
const {checkFromJSM} = ChromeUtils.import(base + "file_expandosharing.jsm");
function inlinefunction() {
return 42;
@ -29,22 +27,21 @@ is(src.charAt(src.length - 1), "}", "inline XUL source should end with '}'");
src = outoflinefunction.toSource();
isnot(src.indexOf("return 42"), -1, "out of line XUL script should have source")
is(src.charAt(src.length - 1), "}", "out of line XUL source should end with '}'");
src = checkFromJSM.toSource();
isnot(src.indexOf("catch"), -1, "JSM should have source");
src = NetUtil.asyncFetch.toSource();
isnot(src.indexOf("return"), -1, "JSM should have source");
var ns = {};
Services.scriptloader.loadSubScript(base + "file_expandosharing.jsm", ns);
src = ns.checkFromJSM.toSource();
isnot(src.indexOf("catch"), -1, "subscript should have source");
Services.scriptloader.loadSubScript("resource://gre/modules/NetUtil.jsm", ns);
src = ns.NetUtil.asyncFetch.toSource();
isnot(src.indexOf("return"), -1, "subscript should have source");
var base = /.*\//.exec(window.location.href)[0];
var reg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
var resolvedBase = reg.convertChromeURL(NetUtil.newURI(base)).spec;
ns = {
base,
};
ns = {};
Services.scriptloader.loadSubScript(resolvedBase + "subscript.js", ns);
src = ns.checkFromJSM.toSource();
isnot(src.indexOf("catch"), -1, "subscript of a subscript should have source");
src = ns.NetUtil.asyncFetch.toSource();
isnot(src.indexOf("return"), -1, "subscript of a subscript should have source");
ns = {};
Services.scriptloader.loadSubScript(resolvedBase + "utf8_subscript.js", ns);

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

@ -1,20 +1,22 @@
function run_test() {
// Existing module.
Assert.ok(!Cu.isModuleLoaded("resource://test/jsm_loaded-1.jsm"),
Assert.ok(Cu.isModuleLoaded("resource://gre/modules/NetUtil.jsm"),
"isModuleLoaded returned correct value for non-loaded module");
ChromeUtils.import("resource://test/jsm_loaded-1.jsm");
Assert.ok(Cu.isModuleLoaded("resource://test/jsm_loaded-1.jsm"),
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
Assert.ok(Cu.isModuleLoaded("resource://gre/modules/NetUtil.jsm"),
"isModuleLoaded returned true after loading that module");
Cu.unload("resource://test/jsm_loaded-1.jsm");
Assert.ok(!Cu.isModuleLoaded("resource://test/jsm_loaded-1.jsm"),
Cu.unload("resource://gre/modules/NetUtil.jsm");
Assert.ok(!Cu.isModuleLoaded("resource://gre/modules/NetUtil.jsm"),
"isModuleLoaded returned false after unloading that module");
// Non-existing module
Assert.ok(!Cu.isModuleLoaded("resource://gre/modules/non-existing-module.jsm"),
"isModuleLoaded returned correct value for non-loaded module");
Assert.throws(
() => ChromeUtils.import("resource://gre/modules/non-existing-module.jsm"),
/NS_ERROR_FILE_NOT_FOUND/,
"Should have thrown while trying to load a non existing file"
);
try {
ChromeUtils.import("resource://gre/modules/non-existing-module.jsm");
Assert.ok(false,
"Should have thrown while trying to load a non existing file");
} catch (ex) {}
Assert.ok(!Cu.isModuleLoaded("resource://gre/modules/non-existing-module.jsm"),
"isModuleLoaded returned correct value for non-loaded module");
}

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

@ -75,39 +75,39 @@ add_task(function test_lazy_proxy() {
add_task(function test_module_version() {
// Test that passing a string instead of an initialization function
// makes this behave like a lazy module getter.
const TEST_FILE_URI = "resource://test/TestFile.jsm";
const NET_UTIL_URI = "resource://gre/modules/NetUtil.jsm";
let underlyingObject;
Cu.unload(TEST_FILE_URI);
Cu.unload(NET_UTIL_URI);
let lazyProxy = XPCOMUtils.defineLazyProxy(
null,
"TestFile",
TEST_FILE_URI,
"NetUtil",
NET_UTIL_URI,
null, /* no stubs */
function untrapCallback(object) {
underlyingObject = object;
}
);
Assert.ok(!Cu.isModuleLoaded(TEST_FILE_URI), "The NetUtil module was not loaded by the lazy proxy definition");
Assert.ok(!Cu.isModuleLoaded(NET_UTIL_URI), "The NetUtil module was not loaded by the lazy proxy definition");
// Access the object, which will evaluate the proxy.
lazyProxy.foo = "bar";
// Module was loaded.
Assert.ok(Cu.isModuleLoaded(TEST_FILE_URI), "The NetUtil module was loaded");
Assert.ok(Cu.isModuleLoaded(NET_UTIL_URI), "The NetUtil module was loaded");
let { TestFile } = ChromeUtils.import(TEST_FILE_URI, {});
let { NetUtil } = ChromeUtils.import(NET_UTIL_URI, {});
// Avoids a gigantic stringification in the logs.
Assert.ok(TestFile === underlyingObject, "The module loaded is the same as the one directly obtained by ChromeUtils.import");
Assert.ok(NetUtil === underlyingObject, "The module loaded is the same as the one directly obtained by ChromeUtils.import");
// Proxy correctly passed the setter to the underlying object.
Assert.equal(TestFile.foo, "bar", "Proxy correctly passed the setter to the underlying object");
Assert.equal(NetUtil.foo, "bar", "Proxy correctly passed the setter to the underlying object");
delete lazyProxy.foo;
// Proxy correctly passed the delete operation to the underlying object.
Assert.ok(!TestFile.hasOwnProperty("foo"), "Proxy correctly passed the delete operation to the underlying object");
Assert.ok(!NetUtil.hasOwnProperty("foo"), "Proxy correctly passed the delete operation to the underlying object");
});

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

@ -1,6 +1,6 @@
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1273251
const {NetUtil} = ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs");
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
const {TestUtils} = ChromeUtils.importESModule("resource://testing-common/TestUtils.sys.mjs");

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
const {NetUtil} = ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs");
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const {TestUtils} = ChromeUtils.importESModule("resource://testing-common/TestUtils.sys.mjs");
function getWindowlessBrowser(url) {

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

@ -4,25 +4,25 @@
function run_test() {
var scope1 = {};
var exports1 = ChromeUtils.import("resource://test/TestFile.jsm", scope1);
var exports1 = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", scope1);
var scope2 = {};
var exports2 = ChromeUtils.import("resource://test/TestFile.jsm", scope2);
var exports2 = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", scope2);
Assert.ok(exports1 === exports2);
Assert.ok(scope1.TestFile === scope2.TestFile);
Assert.ok(scope1.NetUtil === scope2.NetUtil);
Cu.unload("resource://test/TestFile.jsm");
Cu.unload("resource://gre/modules/NetUtil.jsm");
var scope3 = {};
var exports3 = ChromeUtils.import("resource://test/TestFile.jsm", scope3);
var exports3 = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", scope3);
Assert.equal(false, exports1 === exports3);
Assert.equal(false, scope1.TestFile === scope3.TestFile);
Assert.equal(false, scope1.NetUtil === scope3.NetUtil);
// When the jsm was unloaded, the value of all its global's properties were
// set to undefined. While it must be safe (not crash) to call into the
// module, we expect it to throw an error (e.g., when trying to use Ci).
try { scope1.TestFile.doTest(() => {}); } catch (e) {}
try { scope3.TestFile.doTest(() => {}); } catch (e) {}
try { scope1.NetUtil.newURI("http://www.example.com"); } catch (e) {}
try { scope3.NetUtil.newURI("http://www.example.com"); } catch (e) {}
}

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

@ -30,7 +30,7 @@ const {
g,
} = ChromeUtils.import("resource://reftest/globals.jsm");
const { NetUtil } = ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs");
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);

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

@ -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");
// Check that reading non existant inner jars results in the right error

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// Regression test for bug 370103 - crash when passing a null listener to
// nsIChannel.asyncOpen

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

@ -1,8 +1,6 @@
// Make sure we behave appropriately when asking for content-disposition
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const path = "data/test_bug589292.zip";

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

@ -2,9 +2,7 @@
* 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 { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// Check that reading non existant inner jars results in the right error

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

@ -2,9 +2,7 @@
* 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 { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// Check that the zip cache can expire entries from nested jars

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

@ -2,9 +2,7 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// Check that we don't crash on reading a directory entry signature

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

@ -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 { TelemetryTestUtils } = ChromeUtils.importESModule(
"resource://testing-common/TelemetryTestUtils.sys.mjs"

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

@ -8,9 +8,7 @@
const { Constructor: ctor } = Components;
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const ios = Services.io;
const dirSvc = Services.dirsvc;

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

@ -1,8 +1,6 @@
// Should report file not found on non-existent files
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const path = "data/test_bug333423.zip";
function run_test() {

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

@ -3,9 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
// Values taken from using zipinfo to list the test.zip contents
var TESTS = [

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

@ -4,6 +4,8 @@
* 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/. */
var EXPORTED_SYMBOLS = ["NetUtil"];
/**
* Necko utilities
*/
@ -22,7 +24,7 @@ const BinaryInputStream = Components.Constructor(
// //////////////////////////////////////////////////////////////////////////////
// // NetUtil Object
export var NetUtil = {
var NetUtil = {
/**
* Function to perform simple async copying from aSource (an input stream)
* to aSink (an output stream). The copy will happen on some background

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

@ -303,7 +303,7 @@ elif CONFIG["OS_ARCH"] == "Linux":
]
EXTRA_JS_MODULES += [
"NetUtil.sys.mjs",
"NetUtil.jsm",
]
DIRS += ["mozurl", "rust-helper", "http-sfv"]

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const URI = Services.io.newURI("http://example.org/");

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
);

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const BASE_HOST = "example.org";

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function setCookie(name, url) {
let value = `${name}=${Math.random()}; Path=/; Max-Age=1000; sameSite=none; Secure`;

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function inChildProcess() {
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function inChildProcess() {
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function inChildProcess() {
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;

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

@ -1,6 +1,4 @@
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function inChildProcess() {
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;

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

@ -9,8 +9,7 @@
/* global ContentTaskUtils, content */
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const info = console.log;
export var HTTPS_EXAMPLE_ORG = "https://example.org";

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

@ -16,9 +16,7 @@ var linDEBUG = true;
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
/**
* Constructs a new nsHttpServer instance. This function is intended to

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

@ -6,9 +6,7 @@
"use strict";
const { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
);

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

@ -2,9 +2,7 @@
// Load standard base class for network tests into child process
//
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);

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

@ -1,8 +1,6 @@
/* import-globals-from ../unit/head_http3.js */
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);

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

@ -1,8 +1,6 @@
/* import-globals-from ../unit/head_trr.js */
var { NetUtil } = ChromeUtils.importESModule(
"resource://gre/modules/NetUtil.sys.mjs"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);

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

@ -2,12 +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/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { Domain } from "chrome://remote/content/cdp/domains/Domain.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
XPCOMUtils.defineLazyModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});
const MAX_WINDOW_SIZE = 10000000;

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

@ -9,12 +9,15 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
CommonUtils: "resource://services-common/utils.sys.mjs",
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs",
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
ChannelEventSinkFactory:
"chrome://remote/content/cdp/observers/ChannelEventSink.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});
XPCOMUtils.defineLazyServiceGetter(
lazy,
"gActivityDistributor",

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