forked from mirrors/gecko-dev
Backed out 19 changesets (bug 1541508) for causing xpcshell failures on test_notHeadlessByDefault.js CLOSED TREE
Backed out changeset 08476fa2bc27 (bug 1541508) Backed out changeset 0bf7514845db (bug 1541508) Backed out changeset aa612a5e9ef7 (bug 1541508) Backed out changeset 6bb9360473f7 (bug 1541508) Backed out changeset b3d8e92f50c2 (bug 1541508) Backed out changeset fa40dded133e (bug 1541508) Backed out changeset 2e7db4aa8d4f (bug 1541508) Backed out changeset 6098e2eb62ea (bug 1541508) Backed out changeset 2c599ee639c4 (bug 1541508) Backed out changeset 7d44f6e2644c (bug 1541508) Backed out changeset c1279c3d674c (bug 1541508) Backed out changeset 8bd08a62a590 (bug 1541508) Backed out changeset 740010cb005c (bug 1541508) Backed out changeset 0bfc7dd85c62 (bug 1541508) Backed out changeset c4374a351356 (bug 1541508) Backed out changeset 44ccfeca7364 (bug 1541508) Backed out changeset e944e706a523 (bug 1541508) Backed out changeset 2c59d66f43e4 (bug 1541508) Backed out changeset a1896eacb6f1 (bug 1541508)
This commit is contained in:
parent
39ca7d2cd7
commit
4d37cf70f1
194 changed files with 995 additions and 371 deletions
|
|
@ -15,7 +15,11 @@ var DevelopmentHelpers = {
|
||||||
|
|
||||||
quickRestart() {
|
quickRestart() {
|
||||||
Services.obs.notifyObservers(null, "startupcache-invalidate");
|
Services.obs.notifyObservers(null, "startupcache-invalidate");
|
||||||
Services.env.set("MOZ_DISABLE_SAFE_MODE_KEY", "1");
|
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("MOZ_DISABLE_SAFE_MODE_KEY", "1");
|
||||||
|
|
||||||
Services.startup.quit(
|
Services.startup.quit(
|
||||||
Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
|
Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,10 @@ function restartApp() {
|
||||||
|
|
||||||
function resetProfile() {
|
function resetProfile() {
|
||||||
// Set the reset profile environment variable.
|
// Set the reset profile environment variable.
|
||||||
Services.env.set("MOZ_RESET_PROFILE_RESTART", "1");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("MOZ_RESET_PROFILE_RESTART", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
function showResetDialog() {
|
function showResetDialog() {
|
||||||
|
|
|
||||||
|
|
@ -437,7 +437,9 @@ add_task(async function() {
|
||||||
ok(shouldPass, "No unexpected main thread I/O during startup");
|
ok(shouldPass, "No unexpected main thread I/O during startup");
|
||||||
} else {
|
} else {
|
||||||
const filename = "profile_startup_content_mainthreadio.json";
|
const filename = "profile_startup_content_mainthreadio.json";
|
||||||
let path = Services.env.get("MOZ_UPLOAD_DIR");
|
let path = Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(Ci.nsIEnvironment)
|
||||||
|
.get("MOZ_UPLOAD_DIR");
|
||||||
let profilePath = PathUtils.join(path, filename);
|
let profilePath = PathUtils.join(path, filename);
|
||||||
await IOUtils.writeJSON(profilePath, startupRecorder.data.profile);
|
await IOUtils.writeJSON(profilePath, startupRecorder.data.profile);
|
||||||
ok(
|
ok(
|
||||||
|
|
|
||||||
|
|
@ -837,7 +837,9 @@ add_task(async function() {
|
||||||
ok(shouldPass, "No unexpected main thread I/O during startup");
|
ok(shouldPass, "No unexpected main thread I/O during startup");
|
||||||
} else {
|
} else {
|
||||||
const filename = "profile_startup_mainthreadio.json";
|
const filename = "profile_startup_mainthreadio.json";
|
||||||
let path = Services.env.get("MOZ_UPLOAD_DIR");
|
let path = Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(Ci.nsIEnvironment)
|
||||||
|
.get("MOZ_UPLOAD_DIR");
|
||||||
let profilePath = PathUtils.join(path, filename);
|
let profilePath = PathUtils.join(path, filename);
|
||||||
await IOUtils.writeJSON(profilePath, startupRecorder.data.profile);
|
await IOUtils.writeJSON(profilePath, startupRecorder.data.profile);
|
||||||
ok(
|
ok(
|
||||||
|
|
|
||||||
|
|
@ -417,7 +417,9 @@ add_task(async function() {
|
||||||
ok(shouldPass, "No unexpected sync IPC during startup");
|
ok(shouldPass, "No unexpected sync IPC during startup");
|
||||||
} else {
|
} else {
|
||||||
const filename = "profile_startup_syncIPC.json";
|
const filename = "profile_startup_syncIPC.json";
|
||||||
let path = Services.env.get("MOZ_UPLOAD_DIR");
|
let path = Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(Ci.nsIEnvironment)
|
||||||
|
.get("MOZ_UPLOAD_DIR");
|
||||||
let profilePath = PathUtils.join(path, filename);
|
let profilePath = PathUtils.join(path, filename);
|
||||||
await IOUtils.writeJSON(profilePath, startupRecorder.data.profile);
|
await IOUtils.writeJSON(profilePath, startupRecorder.data.profile);
|
||||||
ok(
|
ok(
|
||||||
|
|
|
||||||
|
|
@ -117,14 +117,17 @@ async function setupLocalCrashReportServer() {
|
||||||
// report server, and fortunately one is already set up by toolkit/
|
// report server, and fortunately one is already set up by toolkit/
|
||||||
// crashreporter/test/Makefile.in. Assign its URL to MOZ_CRASHREPORTER_URL,
|
// crashreporter/test/Makefile.in. Assign its URL to MOZ_CRASHREPORTER_URL,
|
||||||
// which CrashSubmit.jsm uses as a server override.
|
// which CrashSubmit.jsm uses as a server override.
|
||||||
let noReport = Services.env.get("MOZ_CRASHREPORTER_NO_REPORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
let serverUrl = Services.env.get("MOZ_CRASHREPORTER_URL");
|
Ci.nsIEnvironment
|
||||||
Services.env.set("MOZ_CRASHREPORTER_NO_REPORT", "");
|
);
|
||||||
Services.env.set("MOZ_CRASHREPORTER_URL", SERVER_URL);
|
let noReport = env.get("MOZ_CRASHREPORTER_NO_REPORT");
|
||||||
|
let serverUrl = env.get("MOZ_CRASHREPORTER_URL");
|
||||||
|
env.set("MOZ_CRASHREPORTER_NO_REPORT", "");
|
||||||
|
env.set("MOZ_CRASHREPORTER_URL", SERVER_URL);
|
||||||
|
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
Services.env.set("MOZ_CRASHREPORTER_NO_REPORT", noReport);
|
env.set("MOZ_CRASHREPORTER_NO_REPORT", noReport);
|
||||||
Services.env.set("MOZ_CRASHREPORTER_URL", serverUrl);
|
env.set("MOZ_CRASHREPORTER_URL", serverUrl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,15 +146,18 @@ function prepareNoDump() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const kBuildidMatchEnv = "MOZ_BUILDID_MATCH_DONTSEND";
|
const kBuildidMatchEnv = "MOZ_BUILDID_MATCH_DONTSEND";
|
||||||
|
const envService = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
function setBuildidMatchDontSendEnv() {
|
function setBuildidMatchDontSendEnv() {
|
||||||
info("Setting " + kBuildidMatchEnv + "=1");
|
info("Setting " + kBuildidMatchEnv + "=1");
|
||||||
Services.env.set(kBuildidMatchEnv, "1");
|
envService.set(kBuildidMatchEnv, "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
function unsetBuildidMatchDontSendEnv() {
|
function unsetBuildidMatchDontSendEnv() {
|
||||||
info("Setting " + kBuildidMatchEnv + "=0");
|
info("Setting " + kBuildidMatchEnv + "=0");
|
||||||
Services.env.set(kBuildidMatchEnv, "0");
|
envService.set(kBuildidMatchEnv, "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEventPromise(eventName, eventKind) {
|
function getEventPromise(eventName, eventKind) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,10 @@ const permissionError =
|
||||||
|
|
||||||
const notFoundError = "error: NotFoundError: The object can not be found here.";
|
const notFoundError = "error: NotFoundError: The object can not be found here.";
|
||||||
|
|
||||||
const isHeadless = Services.env.get("MOZ_HEADLESS");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
const isHeadless = env.get("MOZ_HEADLESS");
|
||||||
|
|
||||||
var gTests = [
|
var gTests = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,10 @@ StartupRecorder.prototype = {
|
||||||
}
|
}
|
||||||
paints = null;
|
paints = null;
|
||||||
|
|
||||||
if (!Services.env.exists("MOZ_PROFILER_STARTUP_PERFORMANCE_TEST")) {
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
if (!env.exists("MOZ_PROFILER_STARTUP_PERFORMANCE_TEST")) {
|
||||||
this._resolve();
|
this._resolve();
|
||||||
this._resolve = null;
|
this._resolve = null;
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -88,14 +88,17 @@ var AttributionCode = {
|
||||||
try {
|
try {
|
||||||
file = Services.dirsvc.get("UpdRootD", Ci.nsIFile);
|
file = Services.dirsvc.get("UpdRootD", Ci.nsIFile);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
// It's most common to test for the profile dir, even though we actually
|
// It's most common to test for the profile dir, even though we actually
|
||||||
// are using the temp dir.
|
// are using the temp dir.
|
||||||
if (
|
if (
|
||||||
ex instanceof Ci.nsIException &&
|
ex instanceof Ci.nsIException &&
|
||||||
ex.result == Cr.NS_ERROR_FAILURE &&
|
ex.result == Cr.NS_ERROR_FAILURE &&
|
||||||
Services.env.exists("XPCSHELL_TEST_PROFILE_DIR")
|
env.exists("XPCSHELL_TEST_PROFILE_DIR")
|
||||||
) {
|
) {
|
||||||
let path = Services.env.get("XPCSHELL_TEST_TEMP_DIR");
|
let path = env.get("XPCSHELL_TEST_TEMP_DIR");
|
||||||
file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
|
file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
|
||||||
file.initWithPath(path);
|
file.initWithPath(path);
|
||||||
file.append("nested_UpdRootD_1");
|
file.append("nested_UpdRootD_1");
|
||||||
|
|
@ -435,7 +438,10 @@ var AttributionCode = {
|
||||||
* Does nothing if called from outside of an xpcshell test.
|
* Does nothing if called from outside of an xpcshell test.
|
||||||
*/
|
*/
|
||||||
_clearCache() {
|
_clearCache() {
|
||||||
if (Services.env.exists("XPCSHELL_TEST_PROFILE_DIR")) {
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
if (env.exists("XPCSHELL_TEST_PROFILE_DIR")) {
|
||||||
gCachedAttrData = null;
|
gCachedAttrData = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,12 @@ const INDEX_QUARANTINE_ERROR = 3;
|
||||||
|
|
||||||
add_setup(function() {
|
add_setup(function() {
|
||||||
// AttributionCode._clearCache is only possible in a testing environment
|
// AttributionCode._clearCache is only possible in a testing environment
|
||||||
Services.env.set("XPCSHELL_TEST_PROFILE_DIR", "testing");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("XPCSHELL_TEST_PROFILE_DIR", "testing");
|
||||||
|
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
Services.env.set("XPCSHELL_TEST_PROFILE_DIR", null);
|
env.set("XPCSHELL_TEST_PROFILE_DIR", null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,10 @@ function ensureNoTelemetry() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,10 @@ const PREF_LOGLEVEL = "browser.policies.loglevel";
|
||||||
const BROWSER_DOCUMENT_URL = AppConstants.BROWSER_CHROME_URL;
|
const BROWSER_DOCUMENT_URL = AppConstants.BROWSER_CHROME_URL;
|
||||||
const ABOUT_CONTRACT = "@mozilla.org/network/protocol/about;1?what=";
|
const ABOUT_CONTRACT = "@mozilla.org/network/protocol/about;1?what=";
|
||||||
|
|
||||||
const isXpcshell = Services.env.exists("XPCSHELL_TEST_PROFILE_DIR");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
const isXpcshell = env.exists("XPCSHELL_TEST_PROFILE_DIR");
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
XPCOMUtils.defineLazyGetter(lazy, "log", () => {
|
||||||
let { ConsoleAPI } = ChromeUtils.importESModule(
|
let { ConsoleAPI } = ChromeUtils.importESModule(
|
||||||
|
|
|
||||||
|
|
@ -172,12 +172,15 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(
|
||||||
let dictionary = getFileResource(types.OTHERDATA, ["persdict.dat"]);
|
let dictionary = getFileResource(types.OTHERDATA, ["persdict.dat"]);
|
||||||
|
|
||||||
let session;
|
let session;
|
||||||
if (Services.env.get("MOZ_RESET_PROFILE_MIGRATE_SESSION")) {
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
if (env.get("MOZ_RESET_PROFILE_MIGRATE_SESSION")) {
|
||||||
// We only want to restore the previous firefox session if the profile refresh was
|
// We only want to restore the previous firefox session if the profile refresh was
|
||||||
// triggered by user. The MOZ_RESET_PROFILE_MIGRATE_SESSION would be set when a user-triggered
|
// triggered by user. The MOZ_RESET_PROFILE_MIGRATE_SESSION would be set when a user-triggered
|
||||||
// profile refresh happened in nsAppRunner.cpp. Hence, we detect the MOZ_RESET_PROFILE_MIGRATE_SESSION
|
// profile refresh happened in nsAppRunner.cpp. Hence, we detect the MOZ_RESET_PROFILE_MIGRATE_SESSION
|
||||||
// to see if session data migration is required.
|
// to see if session data migration is required.
|
||||||
Services.env.set("MOZ_RESET_PROFILE_MIGRATE_SESSION", "");
|
env.set("MOZ_RESET_PROFILE_MIGRATE_SESSION", "");
|
||||||
let sessionCheckpoints = this._getFileObject(
|
let sessionCheckpoints = this._getFileObject(
|
||||||
sourceProfileDir,
|
sourceProfileDir,
|
||||||
"sessionCheckpoints.json"
|
"sessionCheckpoints.json"
|
||||||
|
|
|
||||||
|
|
@ -59,13 +59,18 @@ var MigrationWizard = {
|
||||||
this.isInitialMigration =
|
this.isInitialMigration =
|
||||||
entryPointId == MigrationUtils.MIGRATION_ENTRYPOINT_FIRSTRUN;
|
entryPointId == MigrationUtils.MIGRATION_ENTRYPOINT_FIRSTRUN;
|
||||||
|
|
||||||
// Record that the uninstaller requested a profile refresh
|
{
|
||||||
if (Services.env.get("MOZ_UNINSTALLER_PROFILE_REFRESH")) {
|
// Record that the uninstaller requested a profile refresh
|
||||||
Services.env.set("MOZ_UNINSTALLER_PROFILE_REFRESH", "");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
Services.telemetry.scalarSet(
|
Ci.nsIEnvironment
|
||||||
"migration.uninstaller_profile_refresh",
|
|
||||||
true
|
|
||||||
);
|
);
|
||||||
|
if (env.get("MOZ_UNINSTALLER_PROFILE_REFRESH")) {
|
||||||
|
env.set("MOZ_UNINSTALLER_PROFILE_REFRESH", "");
|
||||||
|
Services.telemetry.scalarSet(
|
||||||
|
"migration.uninstaller_profile_refresh",
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
|
|
|
||||||
|
|
@ -621,18 +621,18 @@ class TestFirefoxRefresh(MarionetteTestCase):
|
||||||
global.profSvc.flush()
|
global.profSvc.flush()
|
||||||
|
|
||||||
// Now add the reset parameters:
|
// Now add the reset parameters:
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
|
||||||
let prefsToKeep = Array.from(Services.prefs.getChildList("marionette."));
|
let prefsToKeep = Array.from(Services.prefs.getChildList("marionette."));
|
||||||
// Add all the modified preferences set from geckoinstance.py to avoid
|
// Add all the modified preferences set from geckoinstance.py to avoid
|
||||||
// non-local connections.
|
// non-local connections.
|
||||||
prefsToKeep = prefsToKeep.concat(JSON.parse(
|
prefsToKeep = prefsToKeep.concat(JSON.parse(env.get("MOZ_MARIONETTE_REQUIRED_PREFS")));
|
||||||
Services.env.get("MOZ_MARIONETTE_REQUIRED_PREFS")));
|
|
||||||
let prefObj = {};
|
let prefObj = {};
|
||||||
for (let pref of prefsToKeep) {
|
for (let pref of prefsToKeep) {
|
||||||
prefObj[pref] = global.Preferences.get(pref);
|
prefObj[pref] = global.Preferences.get(pref);
|
||||||
}
|
}
|
||||||
Services.env.set("MOZ_MARIONETTE_PREF_STATE_ACROSS_RESTARTS", JSON.stringify(prefObj));
|
env.set("MOZ_MARIONETTE_PREF_STATE_ACROSS_RESTARTS", JSON.stringify(prefObj));
|
||||||
Services.env.set("MOZ_RESET_PROFILE_RESTART", "1");
|
env.set("MOZ_RESET_PROFILE_RESTART", "1");
|
||||||
Services.env.set("XRE_PROFILE_PATH", arguments[0]);
|
env.set("XRE_PROFILE_PATH", arguments[0]);
|
||||||
""",
|
""",
|
||||||
script_args=(
|
script_args=(
|
||||||
self.marionette.instance.profile.profile,
|
self.marionette.instance.profile.profile,
|
||||||
|
|
|
||||||
|
|
@ -1735,7 +1735,10 @@ class _ASRouter {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear cache call is only possible in a testing environment
|
// Clear cache call is only possible in a testing environment
|
||||||
Services.env.set("XPCSHELL_TEST_PROFILE_DIR", "testing");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("XPCSHELL_TEST_PROFILE_DIR", "testing");
|
||||||
|
|
||||||
// Clear and refresh Attribution, and then fetch the messages again to update
|
// Clear and refresh Attribution, and then fetch the messages again to update
|
||||||
AttributionCode._clearCache();
|
AttributionCode._clearCache();
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,10 @@ async function openRTAMOWelcomePage() {
|
||||||
registerCleanupFunction(async () => {
|
registerCleanupFunction(async () => {
|
||||||
BrowserTestUtils.removeTab(tab);
|
BrowserTestUtils.removeTab(tab);
|
||||||
// Clear cache call is only possible in a testing environment
|
// Clear cache call is only possible in a testing environment
|
||||||
Services.env.set("XPCSHELL_TEST_PROFILE_DIR", "testing");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("XPCSHELL_TEST_PROFILE_DIR", "testing");
|
||||||
await ASRouter.forceAttribution({
|
await ASRouter.forceAttribution({
|
||||||
source: "",
|
source: "",
|
||||||
medium: "",
|
medium: "",
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ function adjustGeneralPaths() {
|
||||||
// test, so its path can serve to provide the unique key that the update
|
// test, so its path can serve to provide the unique key that the update
|
||||||
// sync manager requires (it doesn't need for this to be the actual
|
// sync manager requires (it doesn't need for this to be the actual
|
||||||
// path to any real file, it's only used as an opaque string).
|
// path to any real file, it's only used as an opaque string).
|
||||||
let tempPath = Services.env.get("MOZ_PROCESS_LOG");
|
let tempPath = gEnv.get("MOZ_PROCESS_LOG");
|
||||||
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
|
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
|
||||||
file.initWithPath(tempPath);
|
file.initWithPath(tempPath);
|
||||||
return file;
|
return file;
|
||||||
|
|
@ -119,7 +119,7 @@ function adjustGeneralPaths() {
|
||||||
* See the files in toolkit/mozapps/update/tests/browser.
|
* See the files in toolkit/mozapps/update/tests/browser.
|
||||||
*/
|
*/
|
||||||
async function initUpdate(params) {
|
async function initUpdate(params) {
|
||||||
Services.env.set("MOZ_TEST_SLOW_SKIP_UPDATE_STAGE", "1");
|
gEnv.set("MOZ_TEST_SLOW_SKIP_UPDATE_STAGE", "1");
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [
|
set: [
|
||||||
[PREF_APP_UPDATE_DISABLEDFORTESTING, false],
|
[PREF_APP_UPDATE_DISABLEDFORTESTING, false],
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,12 @@ add_task(async function detach() {
|
||||||
// editor or selection code in Gecko. Since this has only been observed on Mac
|
// editor or selection code in Gecko. Since this has only been observed on Mac
|
||||||
// in chaos mode and doesn't seem to be a problem in urlbar code, skip the
|
// in chaos mode and doesn't seem to be a problem in urlbar code, skip the
|
||||||
// test in that case.
|
// test in that case.
|
||||||
if (AppConstants.platform == "macosx" && Services.env.get("MOZ_CHAOSMODE")) {
|
if (
|
||||||
|
AppConstants.platform == "macosx" &&
|
||||||
|
Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(SpecialPowers.Ci.nsIEnvironment)
|
||||||
|
.get("MOZ_CHAOSMODE")
|
||||||
|
) {
|
||||||
Assert.ok(true, "Skipping test in chaos mode on Mac");
|
Assert.ok(true, "Skipping test in chaos mode on Mac");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,10 @@ var TabCrashHandler = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for environment affecting crash reporting
|
// check for environment affecting crash reporting
|
||||||
let shutdown = Services.env.exists("MOZ_CRASHREPORTER_SHUTDOWN");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let shutdown = env.exists("MOZ_CRASHREPORTER_SHUTDOWN");
|
||||||
|
|
||||||
if (shutdown) {
|
if (shutdown) {
|
||||||
dump(
|
dump(
|
||||||
|
|
|
||||||
|
|
@ -215,8 +215,11 @@ add_setup(async function() {
|
||||||
notification.close();
|
notification.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
let oldServerURL = Services.env.get("MOZ_CRASHREPORTER_URL");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
Services.env.set("MOZ_CRASHREPORTER_URL", SERVER_URL);
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let oldServerURL = env.get("MOZ_CRASHREPORTER_URL");
|
||||||
|
env.set("MOZ_CRASHREPORTER_URL", SERVER_URL);
|
||||||
|
|
||||||
// nsBrowserGlue starts up UnsubmittedCrashHandler automatically
|
// nsBrowserGlue starts up UnsubmittedCrashHandler automatically
|
||||||
// on a timer, so at this point, it can be in one of several states:
|
// on a timer, so at this point, it can be in one of several states:
|
||||||
|
|
@ -255,7 +258,7 @@ add_setup(async function() {
|
||||||
|
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
clearPendingCrashReports();
|
clearPendingCrashReports();
|
||||||
Services.env.set("MOZ_CRASHREPORTER_URL", oldServerURL);
|
env.set("MOZ_CRASHREPORTER_URL", oldServerURL);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@
|
||||||
const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
|
const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
|
||||||
Ci.nsIChromeRegistry
|
Ci.nsIChromeRegistry
|
||||||
);
|
);
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
const EXTENSION_DIR =
|
const EXTENSION_DIR =
|
||||||
"chrome://mochitests/content/browser/browser/tools/mozscreenshots/mozscreenshots/extension/mozscreenshots/browser/";
|
"chrome://mochitests/content/browser/browser/tools/mozscreenshots/mozscreenshots/extension/mozscreenshots/browser/";
|
||||||
|
|
||||||
|
|
@ -44,7 +47,7 @@ async function setup() {
|
||||||
* @return {bool} whether to capture screenshots.
|
* @return {bool} whether to capture screenshots.
|
||||||
*/
|
*/
|
||||||
function shouldCapture() {
|
function shouldCapture() {
|
||||||
if (Services.env.get("MOZSCREENSHOTS_SETS")) {
|
if (env.get("MOZSCREENSHOTS_SETS")) {
|
||||||
ok(
|
ok(
|
||||||
true,
|
true,
|
||||||
"MOZSCREENSHOTS_SETS was specified so only capture what was " +
|
"MOZSCREENSHOTS_SETS was specified so only capture what was " +
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["TestRunner"];
|
var EXPORTED_SYMBOLS = ["TestRunner"];
|
||||||
|
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
const APPLY_CONFIG_TIMEOUT_MS = 60 * 1000;
|
const APPLY_CONFIG_TIMEOUT_MS = 60 * 1000;
|
||||||
const HOME_PAGE = "resource://mozscreenshots/lib/mozscreenshots.html";
|
const HOME_PAGE = "resource://mozscreenshots/lib/mozscreenshots.html";
|
||||||
|
|
||||||
|
|
@ -94,8 +97,8 @@ var TestRunner = {
|
||||||
];
|
];
|
||||||
let screenshotPath = PathUtils.join(PathUtils.tempDir, ...subDirs);
|
let screenshotPath = PathUtils.join(PathUtils.tempDir, ...subDirs);
|
||||||
|
|
||||||
const MOZ_UPLOAD_DIR = Services.env.get("MOZ_UPLOAD_DIR");
|
const MOZ_UPLOAD_DIR = env.get("MOZ_UPLOAD_DIR");
|
||||||
const GECKO_HEAD_REPOSITORY = Services.env.get("GECKO_HEAD_REPOSITORY");
|
const GECKO_HEAD_REPOSITORY = env.get("GECKO_HEAD_REPOSITORY");
|
||||||
// We don't want to upload images (from MOZ_UPLOAD_DIR) on integration
|
// We don't want to upload images (from MOZ_UPLOAD_DIR) on integration
|
||||||
// branches in order to reduce bandwidth/storage.
|
// branches in order to reduce bandwidth/storage.
|
||||||
if (MOZ_UPLOAD_DIR && !GECKO_HEAD_REPOSITORY.includes("/integration/")) {
|
if (MOZ_UPLOAD_DIR && !GECKO_HEAD_REPOSITORY.includes("/integration/")) {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
/* import-globals-from ../../head.js */
|
/* import-globals-from ../../head.js */
|
||||||
|
|
||||||
add_task(async function capture() {
|
add_task(async function capture() {
|
||||||
let setsEnv = Services.env.get("MOZSCREENSHOTS_SETS");
|
let setsEnv = env.get("MOZSCREENSHOTS_SETS");
|
||||||
if (!setsEnv) {
|
if (!setsEnv) {
|
||||||
ok(
|
ok(
|
||||||
true,
|
true,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ async function getExpectedRuntime() {
|
||||||
|
|
||||||
async function getExpectedRuntimeAll() {
|
async function getExpectedRuntimeAll() {
|
||||||
const runtimesPath = _getExpectedRuntimesPath();
|
const runtimesPath = _getExpectedRuntimesPath();
|
||||||
const currentPath = Services.env.get("PWD");
|
const currentPath = env.get("PWD");
|
||||||
const path = `${currentPath}/${runtimesPath}`;
|
const path = `${currentPath}/${runtimesPath}`;
|
||||||
info(`Load ${path}`);
|
info(`Load ${path}`);
|
||||||
const buffer = await IOUtils.read(path);
|
const buffer = await IOUtils.read(path);
|
||||||
|
|
@ -50,5 +50,8 @@ async function openAboutDebuggingWithADB() {
|
||||||
/* exported openAboutDebuggingWithADB */
|
/* exported openAboutDebuggingWithADB */
|
||||||
|
|
||||||
function _getExpectedRuntimesPath() {
|
function _getExpectedRuntimesPath() {
|
||||||
return Services.env.get("USB_RUNTIMES");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
return env.get("USB_RUNTIMES");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@ XPCOMUtils.defineLazyServiceGetters(lazy, {
|
||||||
const Telemetry = require("resource://devtools/client/shared/telemetry.js");
|
const Telemetry = require("resource://devtools/client/shared/telemetry.js");
|
||||||
const EventEmitter = require("resource://devtools/shared/event-emitter.js");
|
const EventEmitter = require("resource://devtools/shared/event-emitter.js");
|
||||||
|
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
const processes = new Set();
|
const processes = new Set();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -290,7 +294,7 @@ export class BrowserToolboxLauncher extends EventEmitter {
|
||||||
// so that you could pass an optimized build for the browser toolbox.
|
// so that you could pass an optimized build for the browser toolbox.
|
||||||
// This is also useful when debugging a patch that break devtools,
|
// This is also useful when debugging a patch that break devtools,
|
||||||
// so that you could use a build that works for the browser toolbox.
|
// so that you could use a build that works for the browser toolbox.
|
||||||
const customBinaryPath = Services.env.get("MOZ_BROWSER_TOOLBOX_BINARY");
|
const customBinaryPath = env.get("MOZ_BROWSER_TOOLBOX_BINARY");
|
||||||
if (customBinaryPath) {
|
if (customBinaryPath) {
|
||||||
command = customBinaryPath;
|
command = customBinaryPath;
|
||||||
profilePath = lazy.FileUtils.getDir(
|
profilePath = lazy.FileUtils.getDir(
|
||||||
|
|
@ -321,9 +325,7 @@ export class BrowserToolboxLauncher extends EventEmitter {
|
||||||
const environment = {
|
const environment = {
|
||||||
// Allow recording the startup of the browser toolbox when setting
|
// Allow recording the startup of the browser toolbox when setting
|
||||||
// MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP=1 when running firefox.
|
// MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP=1 when running firefox.
|
||||||
MOZ_PROFILER_STARTUP: Services.env.get(
|
MOZ_PROFILER_STARTUP: env.get("MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP"),
|
||||||
"MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP"
|
|
||||||
),
|
|
||||||
// And prevent profiling any subsequent toolbox
|
// And prevent profiling any subsequent toolbox
|
||||||
MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP: "0",
|
MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP: "0",
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,22 @@ add_task(async function() {
|
||||||
// Running devtools should prevent processing updates. By setting this
|
// Running devtools should prevent processing updates. By setting this
|
||||||
// environment variable and then inspecting it from the launched devtools
|
// environment variable and then inspecting it from the launched devtools
|
||||||
// process, we can witness update processing being skipped.
|
// process, we can witness update processing being skipped.
|
||||||
Services.env.set("MOZ_TEST_PROCESS_UPDATES", "1");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("MOZ_TEST_PROCESS_UPDATES", "1");
|
||||||
|
|
||||||
const ToolboxTask = await initBrowserToolboxTask();
|
const ToolboxTask = await initBrowserToolboxTask();
|
||||||
await ToolboxTask.importFunctions({});
|
await ToolboxTask.importFunctions({});
|
||||||
|
|
||||||
let result = await ToolboxTask.spawn(null, async () => {
|
let result = await ToolboxTask.spawn(null, async () => {
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
exists: Services.env.exists("MOZ_TEST_PROCESS_UPDATES"),
|
exists: env.exists("MOZ_TEST_PROCESS_UPDATES"),
|
||||||
get: Services.env.get("MOZ_TEST_PROCESS_UPDATES"),
|
get: env.get("MOZ_TEST_PROCESS_UPDATES"),
|
||||||
};
|
};
|
||||||
// Log so that we have a hope of debugging.
|
// Log so that we have a hope of debugging.
|
||||||
console.log("result", result);
|
console.log("result", result);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ const { LocalizationHelper } = require("resource://devtools/shared/l10n.js");
|
||||||
const L10N = new LocalizationHelper(
|
const L10N = new LocalizationHelper(
|
||||||
"devtools/client/locales/toolbox.properties"
|
"devtools/client/locales/toolbox.properties"
|
||||||
);
|
);
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
const lazy = {};
|
const lazy = {};
|
||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
|
|
@ -84,19 +87,19 @@ var connect = async function() {
|
||||||
// otherwise it is set to "0".
|
// otherwise it is set to "0".
|
||||||
Services.prefs.setBoolPref(
|
Services.prefs.setBoolPref(
|
||||||
"devtools.browsertoolbox.fission",
|
"devtools.browsertoolbox.fission",
|
||||||
Services.env.get("MOZ_BROWSER_TOOLBOX_FISSION_PREF") === "1"
|
env.get("MOZ_BROWSER_TOOLBOX_FISSION_PREF") === "1"
|
||||||
);
|
);
|
||||||
// Similar, but for the WebConsole input context dropdown.
|
// Similar, but for the WebConsole input context dropdown.
|
||||||
Services.prefs.setBoolPref(
|
Services.prefs.setBoolPref(
|
||||||
"devtools.webconsole.input.context",
|
"devtools.webconsole.input.context",
|
||||||
Services.env.get("MOZ_BROWSER_TOOLBOX_INPUT_CONTEXT") === "1"
|
env.get("MOZ_BROWSER_TOOLBOX_INPUT_CONTEXT") === "1"
|
||||||
);
|
);
|
||||||
// Similar, but for the Browser Toolbox mode
|
// Similar, but for the Browser Toolbox mode
|
||||||
if (Services.env.get("MOZ_BROWSER_TOOLBOX_FORCE_MULTIPROCESS") === "1") {
|
if (env.get("MOZ_BROWSER_TOOLBOX_FORCE_MULTIPROCESS") === "1") {
|
||||||
Services.prefs.setCharPref("devtools.browsertoolbox.scope", "everything");
|
Services.prefs.setCharPref("devtools.browsertoolbox.scope", "everything");
|
||||||
}
|
}
|
||||||
|
|
||||||
const port = Services.env.get("MOZ_BROWSER_TOOLBOX_PORT");
|
const port = env.get("MOZ_BROWSER_TOOLBOX_PORT");
|
||||||
|
|
||||||
// A port needs to be passed in from the environment, for instance:
|
// A port needs to be passed in from the environment, for instance:
|
||||||
// MOZ_BROWSER_TOOLBOX_PORT=6080 ./mach run -chrome \
|
// MOZ_BROWSER_TOOLBOX_PORT=6080 ./mach run -chrome \
|
||||||
|
|
@ -251,7 +254,7 @@ async function openToolbox(commands) {
|
||||||
await gToolbox.raise();
|
await gToolbox.raise();
|
||||||
|
|
||||||
// Warn the user if we started recording this browser toolbox via MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP=1
|
// Warn the user if we started recording this browser toolbox via MOZ_BROWSER_TOOLBOX_PROFILER_STARTUP=1
|
||||||
if (Services.env.get("MOZ_PROFILER_STARTUP") === "1") {
|
if (env.get("MOZ_PROFILER_STARTUP") === "1") {
|
||||||
const notificationBox = gToolbox.getNotificationBox();
|
const notificationBox = gToolbox.getNotificationBox();
|
||||||
const text =
|
const text =
|
||||||
"The profiler started recording this toolbox, open another browser toolbox to open the profile via the performance panel";
|
"The profiler started recording this toolbox, open another browser toolbox to open the profile via the performance panel";
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,10 @@ SpecialPowers.pushPrefEnv({
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set DEBUG_DEVTOOLS_ALLOCATIONS=allocations|leaks in order print debug informations.
|
// Set DEBUG_DEVTOOLS_ALLOCATIONS=allocations|leaks in order print debug informations.
|
||||||
const DEBUG_ALLOCATIONS = Services.env.get("DEBUG_DEVTOOLS_ALLOCATIONS");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
const DEBUG_ALLOCATIONS = env.get("DEBUG_DEVTOOLS_ALLOCATIONS");
|
||||||
|
|
||||||
async function addTab(url) {
|
async function addTab(url) {
|
||||||
const tab = BrowserTestUtils.addTab(gBrowser, url);
|
const tab = BrowserTestUtils.addTab(gBrowser, url);
|
||||||
|
|
|
||||||
|
|
@ -147,11 +147,6 @@ declare namespace MockedExports {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Services = {
|
type Services = {
|
||||||
env: {
|
|
||||||
set: (name: string, value: string) => void;
|
|
||||||
get: (name: string) => string;
|
|
||||||
exists: (name: string) => boolean;
|
|
||||||
},
|
|
||||||
prefs: nsIPrefBranch;
|
prefs: nsIPrefBranch;
|
||||||
profiler: {
|
profiler: {
|
||||||
StartProfiler: (
|
StartProfiler: (
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,12 @@ export type RestartBrowserWithEnvironmentVariable = (
|
||||||
*/
|
*/
|
||||||
export type OnProfileReceived = (profile: MinimallyTypedGeckoProfile) => void;
|
export type OnProfileReceived = (profile: MinimallyTypedGeckoProfile) => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the type signature for a function to query the browser for an
|
||||||
|
* environment variable. Currently only implemented for the popup.
|
||||||
|
*/
|
||||||
|
export type GetEnvironmentVariable = (envName: string) => string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the type signature for a function to query the browser for the
|
* This is the type signature for a function to query the browser for the
|
||||||
* ID of the active tab.
|
* ID of the active tab.
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
* @typedef {import("./@types/perf").PerformancePref} PerformancePref
|
* @typedef {import("./@types/perf").PerformancePref} PerformancePref
|
||||||
* @typedef {import("./@types/perf").RecordingSettings} RecordingSettings
|
* @typedef {import("./@types/perf").RecordingSettings} RecordingSettings
|
||||||
* @typedef {import("./@types/perf").RestartBrowserWithEnvironmentVariable} RestartBrowserWithEnvironmentVariable
|
* @typedef {import("./@types/perf").RestartBrowserWithEnvironmentVariable} RestartBrowserWithEnvironmentVariable
|
||||||
|
* @typedef {import("./@types/perf").GetEnvironmentVariable} GetEnvironmentVariable
|
||||||
* @typedef {import("./@types/perf").GetActiveBrowserID} GetActiveBrowserID
|
* @typedef {import("./@types/perf").GetActiveBrowserID} GetActiveBrowserID
|
||||||
* @typedef {import("./@types/perf").MinimallyTypedGeckoProfile} MinimallyTypedGeckoProfile
|
* @typedef {import("./@types/perf").MinimallyTypedGeckoProfile} MinimallyTypedGeckoProfile
|
||||||
* * @typedef {import("./@types/perf").ProfilerViewMode} ProfilerViewMode
|
* * @typedef {import("./@types/perf").ProfilerViewMode} ProfilerViewMode
|
||||||
|
|
@ -136,13 +137,28 @@ function sharedLibrariesFromProfile(profile) {
|
||||||
* @type {RestartBrowserWithEnvironmentVariable}
|
* @type {RestartBrowserWithEnvironmentVariable}
|
||||||
*/
|
*/
|
||||||
function restartBrowserWithEnvironmentVariable(envName, value) {
|
function restartBrowserWithEnvironmentVariable(envName, value) {
|
||||||
Services.env.set(envName, value);
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set(envName, value);
|
||||||
|
|
||||||
Services.startup.quit(
|
Services.startup.quit(
|
||||||
Services.startup.eForceQuit | Services.startup.eRestart
|
Services.startup.eForceQuit | Services.startup.eRestart
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an environment variable from the browser.
|
||||||
|
*
|
||||||
|
* @type {GetEnvironmentVariable}
|
||||||
|
*/
|
||||||
|
function getEnvironmentVariable(envName) {
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
return env.get(envName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Window} window
|
* @param {Window} window
|
||||||
* @param {string[]} objdirs
|
* @param {string[]} objdirs
|
||||||
|
|
@ -168,5 +184,6 @@ module.exports = {
|
||||||
openProfilerTab,
|
openProfilerTab,
|
||||||
sharedLibrariesFromProfile,
|
sharedLibrariesFromProfile,
|
||||||
restartBrowserWithEnvironmentVariable,
|
restartBrowserWithEnvironmentVariable,
|
||||||
|
getEnvironmentVariable,
|
||||||
openFilePickerForObjdir,
|
openFilePickerForObjdir,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,10 @@ function initialize(toggleProfilerKeyShortcuts) {
|
||||||
// but we try to avoid interfering with profiling of automated tests.
|
// but we try to avoid interfering with profiling of automated tests.
|
||||||
if (
|
if (
|
||||||
Services.profiler.IsActive() &&
|
Services.profiler.IsActive() &&
|
||||||
(!Cu.isInAutomation || !Services.env.exists("MOZ_PROFILER_STARTUP"))
|
(!Cu.isInAutomation ||
|
||||||
|
!Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(Ci.nsIEnvironment)
|
||||||
|
.exists("MOZ_PROFILER_STARTUP"))
|
||||||
) {
|
) {
|
||||||
Services.profiler.StopProfiler();
|
Services.profiler.StopProfiler();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const selectors = require("resource://devtools/client/performance-new/store/selectors.js");
|
const selectors = require("resource://devtools/client/performance-new/store/selectors.js");
|
||||||
|
const {
|
||||||
|
getEnvironmentVariable,
|
||||||
|
} = require("resource://devtools/client/performance-new/browser.js");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import("../@types/perf").Action} Action
|
* @typedef {import("../@types/perf").Action} Action
|
||||||
|
|
@ -84,7 +87,7 @@ exports.changeFeatures = features => {
|
||||||
// this hasn't been updated yet for the about:profiling workflow, because
|
// this hasn't been updated yet for the about:profiling workflow, because
|
||||||
// jstracer is disabled for now.
|
// jstracer is disabled for now.
|
||||||
if (
|
if (
|
||||||
!Services.env.get("JS_TRACE_LOGGING") &&
|
!getEnvironmentVariable("JS_TRACE_LOGGING") &&
|
||||||
features.includes("jstracer")
|
features.includes("jstracer")
|
||||||
) {
|
) {
|
||||||
promptEnvRestart = "JS_TRACE_LOGGING";
|
promptEnvRestart = "JS_TRACE_LOGGING";
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
* @typedef {import("../@types/perf").PerfFront} PerfFront
|
* @typedef {import("../@types/perf").PerfFront} PerfFront
|
||||||
* @typedef {import("../@types/perf").ReceiveProfile} ReceiveProfile
|
* @typedef {import("../@types/perf").ReceiveProfile} ReceiveProfile
|
||||||
* @typedef {import("../@types/perf").RestartBrowserWithEnvironmentVariable} RestartBrowserWithEnvironmentVariable
|
* @typedef {import("../@types/perf").RestartBrowserWithEnvironmentVariable} RestartBrowserWithEnvironmentVariable
|
||||||
|
* @typedef {import("../@types/perf").GetEnvironmentVariable} GetEnvironmentVariable
|
||||||
* @typedef {import("../@types/perf").PageContext} PageContext
|
* @typedef {import("../@types/perf").PageContext} PageContext
|
||||||
* @typedef {import("../@types/perf").Presets} Presets
|
* @typedef {import("../@types/perf").Presets} Presets
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,11 @@ add_task(async function test() {
|
||||||
|
|
||||||
{
|
{
|
||||||
info("Ensure that JS Tracer is not currently enabled.");
|
info("Ensure that JS Tracer is not currently enabled.");
|
||||||
|
const {
|
||||||
|
getEnvironmentVariable,
|
||||||
|
} = require("resource://devtools/client/performance-new/browser.js");
|
||||||
ok(
|
ok(
|
||||||
!Services.env.get("JS_TRACE_LOGGING"),
|
!getEnvironmentVariable("JS_TRACE_LOGGING"),
|
||||||
"The JS_TRACE_LOGGING is not currently enabled."
|
"The JS_TRACE_LOGGING is not currently enabled."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,18 @@ const { require } = ChromeUtils.importESModule(
|
||||||
);
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
if (Services.env.get("MOZ_PROFILER_SHUTDOWN")) {
|
const {
|
||||||
|
getEnvironmentVariable,
|
||||||
|
} = require("resource://devtools/client/performance-new/browser.js");
|
||||||
|
|
||||||
|
if (getEnvironmentVariable("MOZ_PROFILER_SHUTDOWN")) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"These tests cannot be run with shutdown profiling as they rely on manipulating " +
|
"These tests cannot be run with shutdown profiling as they rely on manipulating " +
|
||||||
"the state of the profiler."
|
"the state of the profiler."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Services.env.get("MOZ_PROFILER_STARTUP")) {
|
if (getEnvironmentVariable("MOZ_PROFILER_STARTUP")) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"These tests cannot be run with startup profiling as they rely on manipulating " +
|
"These tests cannot be run with startup profiling as they rely on manipulating " +
|
||||||
"the state of the profiler."
|
"the state of the profiler."
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ const EXPRESSIONS_BY_FILE = {
|
||||||
};
|
};
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const isStubsUpdate = Services.env.get(STUBS_UPDATE_ENV) == "true";
|
const isStubsUpdate = env.get(STUBS_UPDATE_ENV) == "true";
|
||||||
|
|
||||||
const tab = await addTab(TEST_URI);
|
const tab = await addTab(TEST_URI);
|
||||||
const {
|
const {
|
||||||
|
|
@ -135,7 +135,7 @@ add_task(async function() {
|
||||||
|
|
||||||
const generatedStubs = await generateStubs(commands, stubFile);
|
const generatedStubs = await generateStubs(commands, stubFile);
|
||||||
if (isStubsUpdate) {
|
if (isStubsUpdate) {
|
||||||
await writeStubsToFile(stubFile, generatedStubs);
|
await writeStubsToFile(env, stubFile, generatedStubs);
|
||||||
ok(true, `${stubFile} was updated`);
|
ok(true, `${stubFile} was updated`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -248,11 +248,12 @@ const STUBS_UPDATE_ENV = "STUBS_UPDATE";
|
||||||
/**
|
/**
|
||||||
* Write stubs to a given file
|
* Write stubs to a given file
|
||||||
*
|
*
|
||||||
|
* @param {Object} env
|
||||||
* @param {String} fileName: The file to write the stubs in.
|
* @param {String} fileName: The file to write the stubs in.
|
||||||
* @param {Map} packets: A Map of the packets.
|
* @param {Map} packets: A Map of the packets.
|
||||||
*/
|
*/
|
||||||
async function writeStubsToFile(fileName, packets) {
|
async function writeStubsToFile(env, fileName, packets) {
|
||||||
const mozRepo = Services.env.get("MOZ_DEVELOPER_REPO_DIR");
|
const mozRepo = env.get("MOZ_DEVELOPER_REPO_DIR");
|
||||||
const filePath = `${mozRepo}/${STUBS_FOLDER + fileName}`;
|
const filePath = `${mozRepo}/${STUBS_FOLDER + fileName}`;
|
||||||
|
|
||||||
const stubs = Array.from(packets.entries()).map(([key, packet]) => {
|
const stubs = Array.from(packets.entries()).map(([key, packet]) => {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,10 @@ const { Constructor: CC } = Components;
|
||||||
|
|
||||||
// Print allocation count if DEBUG_DEVTOOLS_ALLOCATIONS is set to "normal",
|
// Print allocation count if DEBUG_DEVTOOLS_ALLOCATIONS is set to "normal",
|
||||||
// and allocation sites if DEBUG_DEVTOOLS_ALLOCATIONS is set to "verbose".
|
// and allocation sites if DEBUG_DEVTOOLS_ALLOCATIONS is set to "verbose".
|
||||||
const DEBUG_ALLOCATIONS = Services.env.get("DEBUG_DEVTOOLS_ALLOCATIONS");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
const DEBUG_ALLOCATIONS = env.get("DEBUG_DEVTOOLS_ALLOCATIONS");
|
||||||
if (DEBUG_ALLOCATIONS) {
|
if (DEBUG_ALLOCATIONS) {
|
||||||
// Use a custom loader with `invisibleToDebugger` flag for the allocation tracker
|
// Use a custom loader with `invisibleToDebugger` flag for the allocation tracker
|
||||||
// as it instantiates custom Debugger API instances and has to be running in a distinct
|
// as it instantiates custom Debugger API instances and has to be running in a distinct
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ const TEST_URI =
|
||||||
const STUB_FILE = "consoleApi.js";
|
const STUB_FILE = "consoleApi.js";
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const isStubsUpdate = Services.env.get(STUBS_UPDATE_ENV) == "true";
|
const isStubsUpdate = env.get(STUBS_UPDATE_ENV) == "true";
|
||||||
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
||||||
|
|
||||||
const generatedStubs = await generateConsoleApiStubs();
|
const generatedStubs = await generateConsoleApiStubs();
|
||||||
|
|
||||||
if (isStubsUpdate) {
|
if (isStubsUpdate) {
|
||||||
await writeStubsToFile(STUB_FILE, generatedStubs);
|
await writeStubsToFile(env, STUB_FILE, generatedStubs);
|
||||||
ok(true, `${STUB_FILE} was updated`);
|
ok(true, `${STUB_FILE} was updated`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ const TEST_URI =
|
||||||
const STUB_FILE = "cssMessage.js";
|
const STUB_FILE = "cssMessage.js";
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const isStubsUpdate = Services.env.get(STUBS_UPDATE_ENV) == "true";
|
const isStubsUpdate = env.get(STUBS_UPDATE_ENV) == "true";
|
||||||
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
||||||
|
|
||||||
const generatedStubs = await generateCssMessageStubs();
|
const generatedStubs = await generateCssMessageStubs();
|
||||||
|
|
||||||
if (isStubsUpdate) {
|
if (isStubsUpdate) {
|
||||||
await writeStubsToFile(STUB_FILE, generatedStubs);
|
await writeStubsToFile(env, STUB_FILE, generatedStubs);
|
||||||
ok(true, `${STUB_FILE} was updated`);
|
ok(true, `${STUB_FILE} was updated`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ const TEST_URI = "data:text/html;charset=utf-8,<!DOCTYPE html>stub generation";
|
||||||
const STUB_FILE = "evaluationResult.js";
|
const STUB_FILE = "evaluationResult.js";
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const isStubsUpdate = Services.env.get(STUBS_UPDATE_ENV) == "true";
|
const isStubsUpdate = env.get(STUBS_UPDATE_ENV) == "true";
|
||||||
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
||||||
|
|
||||||
const generatedStubs = await generateEvaluationResultStubs();
|
const generatedStubs = await generateEvaluationResultStubs();
|
||||||
|
|
||||||
if (isStubsUpdate) {
|
if (isStubsUpdate) {
|
||||||
await writeStubsToFile(STUB_FILE, generatedStubs);
|
await writeStubsToFile(env, STUB_FILE, generatedStubs);
|
||||||
ok(true, `${STUB_FILE} was updated`);
|
ok(true, `${STUB_FILE} was updated`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ const TEST_URI =
|
||||||
const STUB_FILE = "networkEvent.js";
|
const STUB_FILE = "networkEvent.js";
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const isStubsUpdate = Services.env.get(STUBS_UPDATE_ENV) == "true";
|
const isStubsUpdate = env.get(STUBS_UPDATE_ENV) == "true";
|
||||||
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
||||||
|
|
||||||
const generatedStubs = await generateNetworkEventStubs();
|
const generatedStubs = await generateNetworkEventStubs();
|
||||||
|
|
||||||
if (isStubsUpdate) {
|
if (isStubsUpdate) {
|
||||||
await writeStubsToFile(STUB_FILE, generatedStubs, true);
|
await writeStubsToFile(env, STUB_FILE, generatedStubs, true);
|
||||||
ok(true, `${STUB_FILE} was updated`);
|
ok(true, `${STUB_FILE} was updated`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,13 @@ const STUB_FILE = "pageError.js";
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
await pushPref("javascript.options.asyncstack_capture_debuggee_only", false);
|
await pushPref("javascript.options.asyncstack_capture_debuggee_only", false);
|
||||||
|
|
||||||
const isStubsUpdate = Services.env.get(STUBS_UPDATE_ENV) == "true";
|
const isStubsUpdate = env.get(STUBS_UPDATE_ENV) == "true";
|
||||||
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
||||||
|
|
||||||
const generatedStubs = await generatePageErrorStubs();
|
const generatedStubs = await generatePageErrorStubs();
|
||||||
|
|
||||||
if (isStubsUpdate) {
|
if (isStubsUpdate) {
|
||||||
await writeStubsToFile(STUB_FILE, generatedStubs);
|
await writeStubsToFile(env, STUB_FILE, generatedStubs);
|
||||||
ok(true, `${STUB_FILE} was updated`);
|
ok(true, `${STUB_FILE} was updated`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ const {
|
||||||
const STUB_FILE = "platformMessage.js";
|
const STUB_FILE = "platformMessage.js";
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const isStubsUpdate = Services.env.get(STUBS_UPDATE_ENV) == "true";
|
const isStubsUpdate = env.get(STUBS_UPDATE_ENV) == "true";
|
||||||
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
info(`${isStubsUpdate ? "Update" : "Check"} ${STUB_FILE}`);
|
||||||
|
|
||||||
const generatedStubs = await generatePlatformMessagesStubs();
|
const generatedStubs = await generatePlatformMessagesStubs();
|
||||||
|
|
||||||
if (isStubsUpdate) {
|
if (isStubsUpdate) {
|
||||||
await writeStubsToFile(STUB_FILE, generatedStubs);
|
await writeStubsToFile(env, STUB_FILE, generatedStubs);
|
||||||
ok(true, `${STUB_FILE} was updated`);
|
ok(true, `${STUB_FILE} was updated`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,10 @@ const ProcessDescriptorActor = ActorClassWithSpec(processDescriptorSpec, {
|
||||||
},
|
},
|
||||||
|
|
||||||
get isXpcshell() {
|
get isXpcshell() {
|
||||||
return Services.env.exists("XPCSHELL_TEST_PROFILE_DIR");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
return env.exists("XPCSHELL_TEST_PROFILE_DIR");
|
||||||
},
|
},
|
||||||
|
|
||||||
get isBackgroundTaskMode() {
|
get isBackgroundTaskMode() {
|
||||||
|
|
@ -233,7 +236,10 @@ const ProcessDescriptorActor = ActorClassWithSpec(processDescriptorSpec, {
|
||||||
Services.obs.notifyObservers(null, "startupcache-invalidate");
|
Services.obs.notifyObservers(null, "startupcache-invalidate");
|
||||||
|
|
||||||
// Avoid safemode popup from appearing on restart
|
// Avoid safemode popup from appearing on restart
|
||||||
Services.env.set("MOZ_DISABLE_SAFE_MODE_KEY", "1");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("MOZ_DISABLE_SAFE_MODE_KEY", "1");
|
||||||
|
|
||||||
Services.startup.quit(
|
Services.startup.quit(
|
||||||
Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
|
Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
|
||||||
|
|
|
||||||
|
|
@ -903,10 +903,13 @@ DevToolsStartup.prototype = {
|
||||||
const { BrowserToolboxLauncher } = ChromeUtils.importESModule(
|
const { BrowserToolboxLauncher } = ChromeUtils.importESModule(
|
||||||
"resource://devtools/client/framework/browser-toolbox/Launcher.sys.mjs"
|
"resource://devtools/client/framework/browser-toolbox/Launcher.sys.mjs"
|
||||||
);
|
);
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
// --jsdebugger $binaryPath is an helper alias to set MOZ_BROWSER_TOOLBOX_BINARY=$binaryPath
|
// --jsdebugger $binaryPath is an helper alias to set MOZ_BROWSER_TOOLBOX_BINARY=$binaryPath
|
||||||
// See comment within BrowserToolboxLauncher.
|
// See comment within BrowserToolboxLauncher.
|
||||||
// Setting it as an environment variable helps it being reused if we restart the browser via CmdOrCtrl+R
|
// Setting it as an environment variable helps it being reused if we restart the browser via CmdOrCtrl+R
|
||||||
Services.env.set("MOZ_BROWSER_TOOLBOX_BINARY", binaryPath);
|
env.set("MOZ_BROWSER_TOOLBOX_BINARY", binaryPath);
|
||||||
|
|
||||||
const browserToolboxLauncherConfig = {};
|
const browserToolboxLauncherConfig = {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,8 +109,11 @@ add_task(async function test_background_window() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_minimized() {
|
add_task(async function test_minimized() {
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
// Minimizing windows doesn't supported in headless mode.
|
// Minimizing windows doesn't supported in headless mode.
|
||||||
if (Services.env.get("MOZ_HEADLESS")) {
|
if (env.get("MOZ_HEADLESS")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||||
|
|
||||||
// Returns the test H/2 server port, throwing if it's missing or invalid.
|
// Returns the test H/2 server port, throwing if it's missing or invalid.
|
||||||
function getTestServerPort() {
|
function getTestServerPort() {
|
||||||
let portEnv = Services.env.get("MOZHTTP2_PORT");
|
let portEnv = Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(Ci.nsIEnvironment)
|
||||||
|
.get("MOZHTTP2_PORT");
|
||||||
let port = parseInt(portEnv, 10);
|
let port = parseInt(portEnv, 10);
|
||||||
if (!Number.isFinite(port) || port < 1 || port > 65535) {
|
if (!Number.isFinite(port) || port < 1 || port > 65535) {
|
||||||
throw new Error(`Invalid port in MOZHTTP2_PORT env var: ${portEnv}`);
|
throw new Error(`Invalid port in MOZHTTP2_PORT env var: ${portEnv}`);
|
||||||
|
|
|
||||||
|
|
@ -211,8 +211,11 @@ add_task(async function test_new_window_get() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_minimize_make() {
|
add_task(async function test_minimize_make() {
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
// Minimizing windows doesn't supported in headless mode.
|
// Minimizing windows doesn't supported in headless mode.
|
||||||
if (Services.env.get("MOZ_HEADLESS")) {
|
if (env.get("MOZ_HEADLESS")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -241,8 +244,11 @@ add_task(async function test_minimize_make() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_minimize_get() {
|
add_task(async function test_minimize_get() {
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
// Minimizing windows doesn't supported in headless mode.
|
// Minimizing windows doesn't supported in headless mode.
|
||||||
if (Services.env.get("MOZ_HEADLESS")) {
|
if (env.get("MOZ_HEADLESS")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,10 @@ function displayError(funcname, message) {
|
||||||
|
|
||||||
function getenv(name) {
|
function getenv(name) {
|
||||||
try {
|
try {
|
||||||
return Services.env.get(name);
|
var environment = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
return environment.get(name);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
displayError("getEnvironment", e);
|
displayError("getEnvironment", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
* http://eslint.org/docs/rules/no-unsafe-finally */
|
* http://eslint.org/docs/rules/no-unsafe-finally */
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
let prefs = Services.prefs.getBranch(null);
|
let prefs = Services.prefs.getBranch(null);
|
||||||
let defPrefs = Services.prefs.getDefaultBranch(null);
|
let defPrefs = Services.prefs.getDefaultBranch(null);
|
||||||
|
|
||||||
|
|
@ -26,7 +29,7 @@ function run_test() {
|
||||||
autoConfigCfg.append("autoconfig-all.cfg");
|
autoConfigCfg.append("autoconfig-all.cfg");
|
||||||
autoConfigCfg.copyTo(greD, "autoconfig.cfg");
|
autoConfigCfg.copyTo(greD, "autoconfig.cfg");
|
||||||
|
|
||||||
Services.env.set("AUTOCONFIG_TEST_GETENV", "getenv");
|
env.set("AUTOCONFIG_TEST_GETENV", "getenv");
|
||||||
|
|
||||||
Services.obs.notifyObservers(
|
Services.obs.notifyObservers(
|
||||||
Services.prefs,
|
Services.prefs,
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,12 @@ const { updateAppInfo } = ChromeUtils.import(
|
||||||
);
|
);
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
let testDirName = do_get_cwd().clone();
|
let testDirName = do_get_cwd().clone();
|
||||||
Services.env.set("MOZ_SYSTEM_CONFIG_DIR", testDirName.path);
|
env.set("MOZ_SYSTEM_CONFIG_DIR", testDirName.path);
|
||||||
|
|
||||||
updateAppInfo();
|
updateAppInfo();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,16 @@ function ensureRemove(file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run_test() {
|
async function run_test() {
|
||||||
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
let prefs = Services.prefs.getBranch(null);
|
let prefs = Services.prefs.getBranch(null);
|
||||||
|
|
||||||
let testDir = do_get_cwd();
|
let testDir = do_get_cwd();
|
||||||
let confDir = testDir.clone();
|
let confDir = testDir.clone();
|
||||||
confDir.append("MozSystemConfigDir");
|
confDir.append("MozSystemConfigDir");
|
||||||
Services.env.set("MOZ_SYSTEM_CONFIG_DIR", confDir.path);
|
env.set("MOZ_SYSTEM_CONFIG_DIR", confDir.path);
|
||||||
Services.env.set("SNAP_INSTANCE_NAME", "xpcshell");
|
env.set("SNAP_INSTANCE_NAME", "xpcshell");
|
||||||
|
|
||||||
updateAppInfo();
|
updateAppInfo();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,9 @@ async function test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isOnChaosMode() {
|
function isOnChaosMode() {
|
||||||
return Services.env.get("MOZ_CHAOSMODE");
|
const env = SpecialPowers.Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(SpecialPowers.Ci.nsIEnvironment);
|
||||||
|
return env.get("MOZ_CHAOSMODE");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchParams.get("input-type") == "native-key" &&
|
if (searchParams.get("input-type") == "native-key" &&
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,9 @@ async function test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isOnChaosMode() {
|
function isOnChaosMode() {
|
||||||
return Services.env.get("MOZ_CHAOSMODE");
|
const env = SpecialPowers.Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(SpecialPowers.Ci.nsIEnvironment);
|
||||||
|
return env.get("MOZ_CHAOSMODE");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((getPlatform() == "mac" || getPlatform() == "windows") &&
|
if ((getPlatform() == "mac" || getPlatform() == "windows") &&
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,10 @@ function OnLDBLoad() {
|
||||||
|
|
||||||
if (gArgs.profile) {
|
if (gArgs.profile) {
|
||||||
if (Services.profiler) {
|
if (Services.profiler) {
|
||||||
if (!Services.env.exists("MOZ_PROFILER_SYMBOLICATE")) {
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
if (!env.exists("MOZ_PROFILER_SYMBOLICATE")) {
|
||||||
dump(
|
dump(
|
||||||
"Warning: MOZ_PROFILER_SYMBOLICATE environment variable not set; " +
|
"Warning: MOZ_PROFILER_SYMBOLICATE environment variable not set; " +
|
||||||
"profile will not be symbolicated.\n"
|
"profile will not be symbolicated.\n"
|
||||||
|
|
|
||||||
|
|
@ -472,6 +472,8 @@ function BuildConditionSandbox(aURL) {
|
||||||
sandbox.isCoverageBuild = g.isCoverageBuild;
|
sandbox.isCoverageBuild = g.isCoverageBuild;
|
||||||
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||||
getService(Ci.nsIPrefBranch);
|
getService(Ci.nsIPrefBranch);
|
||||||
|
var env = Cc["@mozilla.org/process/environment;1"].
|
||||||
|
getService(Ci.nsIEnvironment);
|
||||||
|
|
||||||
sandbox.xulRuntime = Cu.cloneInto({widgetToolkit: xr.widgetToolkit, OS: xr.OS, XPCOMABI: xr.XPCOMABI}, sandbox);
|
sandbox.xulRuntime = Cu.cloneInto({widgetToolkit: xr.widgetToolkit, OS: xr.OS, XPCOMABI: xr.XPCOMABI}, sandbox);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ const XHTML_NS = "http://www.w3.org/1999/xhtml";
|
||||||
|
|
||||||
const DEBUG_CONTRACTID = "@mozilla.org/xpcom/debug;1";
|
const DEBUG_CONTRACTID = "@mozilla.org/xpcom/debug;1";
|
||||||
const PRINTSETTINGS_CONTRACTID = "@mozilla.org/gfx/printsettings-service;1";
|
const PRINTSETTINGS_CONTRACTID = "@mozilla.org/gfx/printsettings-service;1";
|
||||||
|
const ENVIRONMENT_CONTRACTID = "@mozilla.org/process/environment;1";
|
||||||
const NS_OBSERVER_SERVICE_CONTRACTID = "@mozilla.org/observer-service;1";
|
const NS_OBSERVER_SERVICE_CONTRACTID = "@mozilla.org/observer-service;1";
|
||||||
const NS_GFXINFO_CONTRACTID = "@mozilla.org/gfx/info;1";
|
const NS_GFXINFO_CONTRACTID = "@mozilla.org/gfx/info;1";
|
||||||
const IO_SERVICE_CONTRACTID = "@mozilla.org/network/io-service;1"
|
const IO_SERVICE_CONTRACTID = "@mozilla.org/network/io-service;1"
|
||||||
|
|
@ -107,7 +108,8 @@ function OnInitialLoad()
|
||||||
if (gDebug.isDebugBuild) {
|
if (gDebug.isDebugBuild) {
|
||||||
gAssertionCount = gDebug.assertionCount;
|
gAssertionCount = gDebug.assertionCount;
|
||||||
}
|
}
|
||||||
gVerbose = !!Services.env.get("MOZ_REFTEST_VERBOSE");
|
var env = Cc[ENVIRONMENT_CONTRACTID].getService(Ci.nsIEnvironment);
|
||||||
|
gVerbose = !!env.get("MOZ_REFTEST_VERBOSE");
|
||||||
|
|
||||||
RegisterMessageListeners();
|
RegisterMessageListeners();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,9 @@ function OnRefTestLoad(win)
|
||||||
g.pendingCrashDumpDir.append("Crash Reports");
|
g.pendingCrashDumpDir.append("Crash Reports");
|
||||||
g.pendingCrashDumpDir.append("pending");
|
g.pendingCrashDumpDir.append("pending");
|
||||||
|
|
||||||
|
var env = Cc["@mozilla.org/process/environment;1"].
|
||||||
|
getService(Ci.nsIEnvironment);
|
||||||
|
|
||||||
g.browserIsRemote = Services.appinfo.browserTabsRemoteAutostart;
|
g.browserIsRemote = Services.appinfo.browserTabsRemoteAutostart;
|
||||||
g.browserIsFission = Services.appinfo.fissionAutostart;
|
g.browserIsFission = Services.appinfo.fissionAutostart;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,10 @@ const { FileUtils } = ChromeUtils.importESModule(
|
||||||
);
|
);
|
||||||
|
|
||||||
// The xpcshell test harness sets PYTHON so we can read it here.
|
// The xpcshell test harness sets PYTHON so we can read it here.
|
||||||
var gPythonName = Services.env.get("PYTHON");
|
var gEnv = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
var gPythonName = gEnv.get("PYTHON");
|
||||||
|
|
||||||
// If we're testing locally, the executable file is in "CurProcD". Otherwise,
|
// If we're testing locally, the executable file is in "CurProcD". Otherwise,
|
||||||
// it is in another location that we have to find.
|
// it is in another location that we have to find.
|
||||||
|
|
@ -134,7 +137,7 @@ function run_test() {
|
||||||
// in-place (to fix stacks) when it runs dmd.py, and that's not safe to do
|
// in-place (to fix stacks) when it runs dmd.py, and that's not safe to do
|
||||||
// asynchronously.
|
// asynchronously.
|
||||||
|
|
||||||
Services.env.set("DMD", "1");
|
gEnv.set("DMD", "1");
|
||||||
|
|
||||||
runProcess(gDmdTestFile, []);
|
runProcess(gDmdTestFile, []);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ var ChildCrashHandler = {
|
||||||
|
|
||||||
aSubject.QueryInterface(Ci.nsIPropertyBag2);
|
aSubject.QueryInterface(Ci.nsIPropertyBag2);
|
||||||
|
|
||||||
const disableReporting = Services.env.get("MOZ_CRASHREPORTER_NO_REPORT");
|
const disableReporting = Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(Ci.nsIEnvironment)
|
||||||
|
.get("MOZ_CRASHREPORTER_NO_REPORT");
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!aSubject.get("abnormal") ||
|
!aSubject.get("abnormal") ||
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,10 @@ var GeckoViewRemoteDebugger = {
|
||||||
//
|
//
|
||||||
// If package name isn't available, it will be "@firefox-debugger-socket".
|
// If package name isn't available, it will be "@firefox-debugger-socket".
|
||||||
|
|
||||||
let packageName = Services.env.get("MOZ_ANDROID_PACKAGE_NAME");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let packageName = env.get("MOZ_ANDROID_PACKAGE_NAME");
|
||||||
if (packageName) {
|
if (packageName) {
|
||||||
packageName = packageName + "/";
|
packageName = packageName + "/";
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -930,7 +930,10 @@ class NodeServer {
|
||||||
// Issues a request to the node server (handler defined in moz-http2.js)
|
// Issues a request to the node server (handler defined in moz-http2.js)
|
||||||
// This method should not be called directly.
|
// This method should not be called directly.
|
||||||
static sendCommand(command, path) {
|
static sendCommand(command, path) {
|
||||||
let h2Port = Services.env.get("MOZNODE_EXEC_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let h2Port = env.get("MOZNODE_EXEC_PORT");
|
||||||
if (!h2Port) {
|
if (!h2Port) {
|
||||||
throw new Error("Could not find MOZNODE_EXEC_PORT");
|
throw new Error("Could not find MOZNODE_EXEC_PORT");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -384,13 +384,16 @@ async function asyncStartTLSTestServer(
|
||||||
|
|
||||||
const CALLBACK_PORT = 8444;
|
const CALLBACK_PORT = 8444;
|
||||||
|
|
||||||
|
let envSvc = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
let greBinDir = Services.dirsvc.get("GreBinD", Ci.nsIFile);
|
let greBinDir = Services.dirsvc.get("GreBinD", Ci.nsIFile);
|
||||||
Services.env.set("DYLD_LIBRARY_PATH", greBinDir.path);
|
envSvc.set("DYLD_LIBRARY_PATH", greBinDir.path);
|
||||||
// TODO(bug 1107794): Android libraries are in /data/local/xpcb, but "GreBinD"
|
// TODO(bug 1107794): Android libraries are in /data/local/xpcb, but "GreBinD"
|
||||||
// does not return this path on Android, so hard code it here.
|
// does not return this path on Android, so hard code it here.
|
||||||
Services.env.set("LD_LIBRARY_PATH", greBinDir.path + ":/data/local/xpcb");
|
envSvc.set("LD_LIBRARY_PATH", greBinDir.path + ":/data/local/xpcb");
|
||||||
Services.env.set("MOZ_TLS_SERVER_DEBUG_LEVEL", "3");
|
envSvc.set("MOZ_TLS_SERVER_DEBUG_LEVEL", "3");
|
||||||
Services.env.set("MOZ_TLS_SERVER_CALLBACK_PORT", CALLBACK_PORT);
|
envSvc.set("MOZ_TLS_SERVER_CALLBACK_PORT", CALLBACK_PORT);
|
||||||
|
|
||||||
let httpServer = new HttpServer();
|
let httpServer = new HttpServer();
|
||||||
let serverReady = new Promise(resolve => {
|
let serverReady = new Promise(resolve => {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@
|
||||||
/* import-globals-from head_cookies.js */
|
/* import-globals-from head_cookies.js */
|
||||||
|
|
||||||
async function http3_setup_tests(http3version) {
|
async function http3_setup_tests(http3version) {
|
||||||
let h3Port = Services.env.get("MOZHTTP3_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
|
let h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
let h3Route = "foo.example.com:" + h3Port;
|
let h3Route = "foo.example.com:" + h3Port;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,10 @@ let gDNS;
|
||||||
function trr_test_setup() {
|
function trr_test_setup() {
|
||||||
dump("start!\n");
|
dump("start!\n");
|
||||||
|
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,10 @@ var httpBarOrigin; // http://bar.example.com:PORT/
|
||||||
var httpsBarOrigin; // https://bar.example.com:PORT/
|
var httpsBarOrigin; // https://bar.example.com:PORT/
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@ var httpBarOrigin; // http://bar.example.com:PORT/
|
||||||
var httpsBarOrigin; // https://bar.example.com:PORT/
|
var httpsBarOrigin; // https://bar.example.com:PORT/
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
h3Port = Services.env.get("MOZHTTP3_PORT");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,10 @@ function run_next_test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
h3Port = Services.env.get("MOZHTTP3_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
h3AltSvc = ":" + h3Port;
|
h3AltSvc = ":" + h3Port;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,10 @@ var http2pref;
|
||||||
var extpref;
|
var extpref;
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,9 @@ add_task(async function test_redirect_https() {
|
||||||
Services.prefs.setBoolPref(PREF_CAPTIVE_ENABLED, false);
|
Services.prefs.setBoolPref(PREF_CAPTIVE_ENABLED, false);
|
||||||
equal(cps.state, Ci.nsICaptivePortalService.UNKNOWN);
|
equal(cps.state, Ci.nsICaptivePortalService.UNKNOWN);
|
||||||
|
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let h2Port = Cc["@mozilla.org/process/environment;1"]
|
||||||
|
.getService(Ci.nsIEnvironment)
|
||||||
|
.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,10 @@ const { TestUtils } = ChromeUtils.import(
|
||||||
);
|
);
|
||||||
|
|
||||||
add_setup(async function setup() {
|
add_setup(async function setup() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,10 @@ let http2Port;
|
||||||
|
|
||||||
add_task(async function setup() {
|
add_task(async function setup() {
|
||||||
Services.prefs.setCharPref("network.dns.localDomains", "foo.example.com");
|
Services.prefs.setCharPref("network.dns.localDomains", "foo.example.com");
|
||||||
http2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
http2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(http2Port, null);
|
Assert.notEqual(http2Port, null);
|
||||||
Assert.notEqual(http2Port, "");
|
Assert.notEqual(http2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,10 @@ function run_test() {
|
||||||
Services.prefs.clearUserPref("network.dns.localDomains");
|
Services.prefs.clearUserPref("network.dns.localDomains");
|
||||||
});
|
});
|
||||||
|
|
||||||
var serverPort = Services.env.get("MOZHTTP2_PORT");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
var serverPort = env.get("MOZHTTP2_PORT");
|
||||||
make_and_open_channel(
|
make_and_open_channel(
|
||||||
"https://foo.example.com:" + serverPort + "/server-timing",
|
"https://foo.example.com:" + serverPort + "/server-timing",
|
||||||
readServerContent
|
readServerContent
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,10 @@ add_task(async function setup() {
|
||||||
);
|
);
|
||||||
addCertFromFile(certdb, "http2-ca.pem", "CTu,u,u");
|
addCertFromFile(certdb, "http2-ca.pem", "CTu,u,u");
|
||||||
|
|
||||||
let proxy_port = Services.env.get("MOZHTTP2_PORT");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let proxy_port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(proxy_port, null);
|
Assert.notEqual(proxy_port, null);
|
||||||
|
|
||||||
Services.prefs.setBoolPref("network.http.http2.enabled", true);
|
Services.prefs.setBoolPref("network.http.http2.enabled", true);
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,10 @@ add_task(async function setup() {
|
||||||
);
|
);
|
||||||
addCertFromFile(certdb, "http2-ca.pem", "CTu,u,u");
|
addCertFromFile(certdb, "http2-ca.pem", "CTu,u,u");
|
||||||
|
|
||||||
let server_port = Services.env.get("MOZHTTP2_PORT");
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let server_port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(server_port, null);
|
Assert.notEqual(server_port, null);
|
||||||
processId = await NodeServer.fork();
|
processId = await NodeServer.fork();
|
||||||
await NodeServer.execute(processId, `serverPort = ${server_port}`);
|
await NodeServer.execute(processId, `serverPort = ${server_port}`);
|
||||||
|
|
|
||||||
|
|
@ -1388,7 +1388,10 @@ function resetPrefs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
serverPort = Services.env.get("MOZHTTP2_PORT");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
serverPort = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(serverPort, null);
|
Assert.notEqual(serverPort, null);
|
||||||
dump("using port " + serverPort + "\n");
|
dump("using port " + serverPort + "\n");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,13 @@ function run_next_test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
let h3Port = Services.env.get("MOZHTTP3_PORT");
|
let h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
h3AltSvc = ":" + h3Port;
|
h3AltSvc = ":" + h3Port;
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,13 @@ function run_next_test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
let h3Port = Services.env.get("MOZHTTP3_PORT");
|
let h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
h3AltSvc = ":" + h3Port;
|
h3AltSvc = ":" + h3Port;
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,13 @@ function run_next_test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
let h3Port = Services.env.get("MOZHTTP3_PORT");
|
let h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
h3AltSvc = ":" + h3Port;
|
h3AltSvc = ":" + h3Port;
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,14 @@ const certOverrideService = Cc[
|
||||||
].getService(Ci.nsICertOverrideService);
|
].getService(Ci.nsICertOverrideService);
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
h3Port = Services.env.get("MOZHTTP3_PORT");
|
h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
Services.prefs.setBoolPref("network.http.http3.enable", true);
|
Services.prefs.setBoolPref("network.http.http3.enable", true);
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,13 @@ function makeChan() {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function test_setup() {
|
add_task(async function test_setup() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
let h3Port = Services.env.get("MOZHTTP3_PORT_NO_RESPONSE");
|
let h3Port = env.get("MOZHTTP3_PORT_NO_RESPONSE");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,14 @@ const certOverrideService = Cc[
|
||||||
].getService(Ci.nsICertOverrideService);
|
].getService(Ci.nsICertOverrideService);
|
||||||
|
|
||||||
add_setup(async function setup() {
|
add_setup(async function setup() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
h3Port = Services.env.get("MOZHTTP3_PORT_NO_RESPONSE");
|
h3Port = env.get("MOZHTTP3_PORT_NO_RESPONSE");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,14 @@ function altsvcSetupPromise(chan, listener) {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function test_fatal_error() {
|
add_task(async function test_fatal_error() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
|
|
||||||
let h3Port = Services.env.get("MOZHTTP3_PORT_FAILED");
|
let h3Port = env.get("MOZHTTP3_PORT_FAILED");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,13 @@ function run_next_test() {
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
function run_test() {
|
function run_test() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
let h3Port = Services.env.get("MOZHTTP3_PORT");
|
let h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
h3AltSvc = ":" + h3Port;
|
h3AltSvc = ":" + h3Port;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,11 @@ function altsvcSetupPromise(chan, listener) {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_task(async function test_fatal_error() {
|
add_task(async function test_fatal_error() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
|
|
||||||
Services.prefs.setBoolPref("network.http.http3.enable", true);
|
Services.prefs.setBoolPref("network.http.http3.enable", true);
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,11 @@ registerCleanupFunction(async () => {
|
||||||
let httpsUri;
|
let httpsUri;
|
||||||
|
|
||||||
add_task(async function pre_setup() {
|
add_task(async function pre_setup() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
httpsUri = "https://foo.example.com:" + h2Port + "/";
|
httpsUri = "https://foo.example.com:" + h2Port + "/";
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,10 @@ let cancelDuringOnStartListener = {
|
||||||
var uri = ios.newURI("http://site3.com/");
|
var uri = ios.newURI("http://site3.com/");
|
||||||
|
|
||||||
// Need to set NECKO_ERRORS_ARE_FATAL=0 else we'll abort process
|
// Need to set NECKO_ERRORS_ARE_FATAL=0 else we'll abort process
|
||||||
Services.env.set("NECKO_ERRORS_ARE_FATAL", "0");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
env.set("NECKO_ERRORS_ARE_FATAL", "0");
|
||||||
// we expect setting referrer to fail
|
// we expect setting referrer to fail
|
||||||
try {
|
try {
|
||||||
request.referrerInfo = new ReferrerInfo(
|
request.referrerInfo = new ReferrerInfo(
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ const certOverrideService = Cc[
|
||||||
"@mozilla.org/security/certoverride;1"
|
"@mozilla.org/security/certoverride;1"
|
||||||
].getService(Ci.nsICertOverrideService);
|
].getService(Ci.nsICertOverrideService);
|
||||||
|
|
||||||
|
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
function setup() {
|
function setup() {
|
||||||
// Allow telemetry probes which may otherwise be disabled for some
|
// Allow telemetry probes which may otherwise be disabled for some
|
||||||
// applications (e.g. Thunderbird).
|
// applications (e.g. Thunderbird).
|
||||||
|
|
@ -30,7 +34,7 @@ function setup() {
|
||||||
Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRONLY);
|
Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRONLY);
|
||||||
|
|
||||||
// Set the server to always select http/1.1
|
// Set the server to always select http/1.1
|
||||||
Services.env.set("MOZ_TLS_ECH_ALPN_FLAG", 1);
|
env.set("MOZ_TLS_ECH_ALPN_FLAG", 1);
|
||||||
|
|
||||||
add_tls_server_setup(
|
add_tls_server_setup(
|
||||||
"EncryptedClientHelloServer",
|
"EncryptedClientHelloServer",
|
||||||
|
|
@ -50,7 +54,7 @@ registerCleanupFunction(async () => {
|
||||||
Services.prefs.clearUserPref("network.dns.echconfig.fallback_to_origin");
|
Services.prefs.clearUserPref("network.dns.echconfig.fallback_to_origin");
|
||||||
Services.prefs.clearUserPref("network.http.speculative-parallel-limit");
|
Services.prefs.clearUserPref("network.http.speculative-parallel-limit");
|
||||||
Services.prefs.clearUserPref("network.dns.port_prefixed_qname_https_rr");
|
Services.prefs.clearUserPref("network.dns.port_prefixed_qname_https_rr");
|
||||||
Services.env.set("MOZ_TLS_ECH_ALPN_FLAG", "");
|
env.set("MOZ_TLS_ECH_ALPN_FLAG", "");
|
||||||
if (trrServer) {
|
if (trrServer) {
|
||||||
await trrServer.stop();
|
await trrServer.stop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,10 @@ const { TestUtils } = ChromeUtils.import(
|
||||||
add_setup(async function setup() {
|
add_setup(async function setup() {
|
||||||
trr_test_setup();
|
trr_test_setup();
|
||||||
|
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@ const { TestUtils } = ChromeUtils.import(
|
||||||
);
|
);
|
||||||
|
|
||||||
add_setup(async function setup() {
|
add_setup(async function setup() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,14 @@ function setup() {
|
||||||
"../../../security/manager/ssl/tests/unit/test_encrypted_client_hello"
|
"../../../security/manager/ssl/tests/unit/test_encrypted_client_hello"
|
||||||
);
|
);
|
||||||
|
|
||||||
h3Port = Services.env.get("MOZHTTP3_PORT_ECH");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h3Port = env.get("MOZHTTP3_PORT_ECH");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
|
|
||||||
h3EchConfig = Services.env.get("MOZHTTP3_ECH");
|
h3EchConfig = env.get("MOZHTTP3_ECH");
|
||||||
Assert.notEqual(h3EchConfig, null);
|
Assert.notEqual(h3EchConfig, null);
|
||||||
Assert.notEqual(h3EchConfig, "");
|
Assert.notEqual(h3EchConfig, "");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ var origin;
|
||||||
var rcwnpref;
|
var rcwnpref;
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
var h2Port = Services.env.get("MOZHTTP2_PORT");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
var h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,10 @@ function setup() {
|
||||||
Services.prefs.setIntPref("network.max_socket_process_failed_count", 2);
|
Services.prefs.setIntPref("network.max_socket_process_failed_count", 2);
|
||||||
trr_test_setup();
|
trr_test_setup();
|
||||||
|
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@ var extpref;
|
||||||
var loadGroup;
|
var loadGroup;
|
||||||
|
|
||||||
function run_test() {
|
function run_test() {
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
var env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,10 @@ async function get_response(channel, fromCache) {
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
do_get_profile();
|
do_get_profile();
|
||||||
const PORT = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
const PORT = env.get("MOZHTTP2_PORT");
|
||||||
const URI = `https://localhost:${PORT}/stale-while-revalidate-loop-test`;
|
const URI = `https://localhost:${PORT}/stale-while-revalidate-loop-test`;
|
||||||
|
|
||||||
let certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(
|
let certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,11 @@ registerCleanupFunction(async () => {
|
||||||
let httpsUri;
|
let httpsUri;
|
||||||
|
|
||||||
add_task(async function setup() {
|
add_task(async function setup() {
|
||||||
let h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
|
||||||
|
let h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
httpsUri = "https://foo.example.com:" + h2Port + "/";
|
httpsUri = "https://foo.example.com:" + h2Port + "/";
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,18 @@ const certOverrideService = Cc[
|
||||||
add_setup(async function setup() {
|
add_setup(async function setup() {
|
||||||
trr_test_setup();
|
trr_test_setup();
|
||||||
|
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
h3Port = Services.env.get("MOZHTTP3_PORT");
|
h3Port = env.get("MOZHTTP3_PORT");
|
||||||
Assert.notEqual(h3Port, null);
|
Assert.notEqual(h3Port, null);
|
||||||
Assert.notEqual(h3Port, "");
|
Assert.notEqual(h3Port, "");
|
||||||
|
|
||||||
h3NoResponsePort = Services.env.get("MOZHTTP3_PORT_NO_RESPONSE");
|
h3NoResponsePort = env.get("MOZHTTP3_PORT_NO_RESPONSE");
|
||||||
Assert.notEqual(h3NoResponsePort, null);
|
Assert.notEqual(h3NoResponsePort, null);
|
||||||
Assert.notEqual(h3NoResponsePort, "");
|
Assert.notEqual(h3NoResponsePort, "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,10 @@ add_setup(async function setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
trr_test_setup();
|
trr_test_setup();
|
||||||
h2Port = Services.env.get("MOZHTTP2_PORT");
|
let env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||||
|
Ci.nsIEnvironment
|
||||||
|
);
|
||||||
|
h2Port = env.get("MOZHTTP2_PORT");
|
||||||
Assert.notEqual(h2Port, null);
|
Assert.notEqual(h2Port, null);
|
||||||
Assert.notEqual(h2Port, "");
|
Assert.notEqual(h2Port, "");
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue