Bug 1856104 - Remove useless version checks from JavaScript code. r=Gijs,webcompat-reviewers,settings-reviewers,search-reviewers,Standard8,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D189696
This commit is contained in:
@@ -4671,12 +4671,8 @@ let gShareUtils = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only support "share URL" on macOS and on Windows 10:
|
// We only support "share URL" on macOS and on Windows:
|
||||||
if (
|
if (AppConstants.platform != "macosx" && AppConstants.platform != "win") {
|
||||||
AppConstants.platform != "macosx" &&
|
|
||||||
// Windows 10's internal NT version number was initially 6.4
|
|
||||||
!AppConstants.isPlatformAndVersionAtLeast("win", "6.4")
|
|
||||||
) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6624,7 +6620,7 @@ var TabletModeUpdater = {
|
|||||||
var gTabletModePageCounter = {
|
var gTabletModePageCounter = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
inc() {
|
inc() {
|
||||||
this.enabled = AppConstants.isPlatformAndVersionAtLeast("win", "10.0");
|
this.enabled = AppConstants.platform == "win";
|
||||||
if (!this.enabled) {
|
if (!this.enabled) {
|
||||||
this.inc = () => {};
|
this.inc = () => {};
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -41,12 +41,6 @@ add_task(async function test_contextmenu_share_win() {
|
|||||||
"hidden"
|
"hidden"
|
||||||
);
|
);
|
||||||
let itemCreated = contextMenu.querySelector(".share-tab-url-item");
|
let itemCreated = contextMenu.querySelector(".share-tab-url-item");
|
||||||
if (!AppConstants.isPlatformAndVersionAtLeast("win", "6.4")) {
|
|
||||||
Assert.ok(!itemCreated, "We only expose share on windows 10 and above");
|
|
||||||
contextMenu.hidePopup();
|
|
||||||
await contextMenuClosedPromise;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ok(itemCreated, "Got Share item on Windows 10");
|
ok(itemCreated, "Got Share item on Windows 10");
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ async function openAndCheckContextMenu(contextMenu, target) {
|
|||||||
contextMenu.hidePopup();
|
contextMenu.hidePopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that we can run touch events properly for windows [10]
|
// Ensure that we can run touch events properly for windows
|
||||||
add_setup(async function () {
|
add_setup(async function () {
|
||||||
let isWindows = AppConstants.isPlatformAndVersionAtLeast("win", "10.0");
|
let isWindows = AppConstants.platform == "win";
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [["apz.test.fails_with_native_injection", isWindows]],
|
set: [["apz.test.fails_with_native_injection", isWindows]],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -793,7 +793,7 @@ add_task(async function test_scrollbar_props() {
|
|||||||
BrowserTestUtils.removeTab(tab);
|
BrowserTestUtils.removeTab(tab);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
|
if (AppConstants.platform == "win") {
|
||||||
add_task(async function test_darkmode() {
|
add_task(async function test_darkmode() {
|
||||||
let lightSelectColor = rgbaToString(
|
let lightSelectColor = rgbaToString(
|
||||||
InspectorUtils.colorToRGBA("MenuText", document)
|
InspectorUtils.colorToRGBA("MenuText", document)
|
||||||
|
|||||||
@@ -111,9 +111,9 @@ async function openAndCheckCustomizationUIMenu(target) {
|
|||||||
menu.hidePopup();
|
menu.hidePopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that we can run touch events properly for windows [10]
|
// Ensure that we can run touch events properly for windows
|
||||||
add_setup(async function () {
|
add_setup(async function () {
|
||||||
let isWindows = AppConstants.isPlatformAndVersionAtLeast("win", "10.0");
|
let isWindows = AppConstants.platform == "win";
|
||||||
await SpecialPowers.pushPrefEnv({
|
await SpecialPowers.pushPrefEnv({
|
||||||
set: [["apz.test.fails_with_native_injection", isWindows]],
|
set: [["apz.test.fails_with_native_injection", isWindows]],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1463,9 +1463,8 @@ CustomizeMode.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add menu items for automatically switching to Touch mode in Windows Tablet Mode,
|
// Add menu items for automatically switching to Touch mode in Windows Tablet Mode.
|
||||||
// which is only available in Windows 10.
|
if (AppConstants.platform == "win") {
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
|
|
||||||
let spacer = doc.getElementById("customization-uidensity-touch-spacer");
|
let spacer = doc.getElementById("customization-uidensity-touch-spacer");
|
||||||
let checkbox = doc.getElementById(
|
let checkbox = doc.getElementById(
|
||||||
"customization-uidensity-autotouchmode-checkbox"
|
"customization-uidensity-autotouchmode-checkbox"
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ add_task(async function test_touch_mode_menuitem() {
|
|||||||
await testModeMenuitem("touch", window.gUIDensity.MODE_TOUCH);
|
await testModeMenuitem("touch", window.gUIDensity.MODE_TOUCH);
|
||||||
|
|
||||||
// Test the checkbox for automatic Touch Mode transition
|
// Test the checkbox for automatic Touch Mode transition
|
||||||
// in Windows 10 Tablet Mode.
|
// in Windows Tablet Mode.
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
|
if (AppConstants.platform == "win") {
|
||||||
await startCustomizing();
|
await startCustomizing();
|
||||||
|
|
||||||
let popupButton = document.getElementById("customization-uidensity-button");
|
let popupButton = document.getElementById("customization-uidensity-button");
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||||||
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
|
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
|
||||||
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
||||||
Sqlite: "resource://gre/modules/Sqlite.sys.mjs",
|
Sqlite: "resource://gre/modules/Sqlite.sys.mjs",
|
||||||
WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs",
|
|
||||||
setTimeout: "resource://gre/modules/Timer.sys.mjs",
|
setTimeout: "resource://gre/modules/Timer.sys.mjs",
|
||||||
MigrationWizardConstants:
|
MigrationWizardConstants:
|
||||||
"chrome://browser/content/migration/migration-wizard-constants.mjs",
|
"chrome://browser/content/migration/migration-wizard-constants.mjs",
|
||||||
@@ -23,7 +22,6 @@ var gMigrators = null;
|
|||||||
var gFileMigrators = null;
|
var gFileMigrators = null;
|
||||||
var gProfileStartup = null;
|
var gProfileStartup = null;
|
||||||
var gL10n = null;
|
var gL10n = null;
|
||||||
var gPreviousDefaultBrowserKey = "";
|
|
||||||
var gHasOpenedLegacyWizard = false;
|
var gHasOpenedLegacyWizard = false;
|
||||||
|
|
||||||
let gForceExitSpinResolve = false;
|
let gForceExitSpinResolve = false;
|
||||||
@@ -500,51 +498,6 @@ class MigrationUtils {
|
|||||||
console.error("Could not detect default browser: ", ex);
|
console.error("Could not detect default browser: ", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// "firefox" is the least useful entry here, and might just be because we've set
|
|
||||||
// ourselves as the default (on Windows 7 and below). In that case, check if we
|
|
||||||
// have a registry key that tells us where to go:
|
|
||||||
if (
|
|
||||||
key == "firefox" &&
|
|
||||||
AppConstants.isPlatformAndVersionAtMost("win", "6.2")
|
|
||||||
) {
|
|
||||||
// Because we remove the registry key, reading the registry key only works once.
|
|
||||||
// We save the value for subsequent calls to avoid hard-to-trace bugs when multiple
|
|
||||||
// consumers ask for this key.
|
|
||||||
if (gPreviousDefaultBrowserKey) {
|
|
||||||
key = gPreviousDefaultBrowserKey;
|
|
||||||
} else {
|
|
||||||
// We didn't have a saved value, so check the registry.
|
|
||||||
const kRegPath = "Software\\Mozilla\\Firefox";
|
|
||||||
let oldDefault = lazy.WindowsRegistry.readRegKey(
|
|
||||||
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
kRegPath,
|
|
||||||
"OldDefaultBrowserCommand"
|
|
||||||
);
|
|
||||||
if (oldDefault) {
|
|
||||||
// Remove the key:
|
|
||||||
lazy.WindowsRegistry.removeRegKey(
|
|
||||||
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
kRegPath,
|
|
||||||
"OldDefaultBrowserCommand"
|
|
||||||
);
|
|
||||||
try {
|
|
||||||
let file = Cc["@mozilla.org/file/local;1"].createInstance(
|
|
||||||
Ci.nsILocalFileWin
|
|
||||||
);
|
|
||||||
file.initWithCommandLine(oldDefault);
|
|
||||||
key =
|
|
||||||
APP_DESC_TO_KEY[file.getVersionInfoField("FileDescription")] ||
|
|
||||||
key;
|
|
||||||
// Save the value for future callers.
|
|
||||||
gPreviousDefaultBrowserKey = key;
|
|
||||||
} catch (ex) {
|
|
||||||
console.error(
|
|
||||||
"Could not convert old default browser value to description."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -690,13 +690,6 @@ async function prepareContentForReact(content) {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change content for Windows 7 because non-light themes aren't quite right.
|
|
||||||
if (AppConstants.isPlatformAndVersionAtMost("win", "6.1")) {
|
|
||||||
await lazy.AWScreenUtils.removeScreens(screens, screen =>
|
|
||||||
["theme"].includes(screen.content?.tiles?.type)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the primary import button source based on attribution.
|
// Set the primary import button source based on attribution.
|
||||||
if (content?.ua) {
|
if (content?.ua) {
|
||||||
// If available, add the browser source to action data
|
// If available, add the browser source to action data
|
||||||
|
|||||||
@@ -196,11 +196,6 @@ add_task(async function test_multistage_aboutwelcome_default() {
|
|||||||
|
|
||||||
await onButtonClick(browser, "button.primary");
|
await onButtonClick(browser, "button.primary");
|
||||||
|
|
||||||
// No 3rd screen to go to for win7.
|
|
||||||
if (win7Content) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await test_screen_content(
|
await test_screen_content(
|
||||||
browser,
|
browser,
|
||||||
"multistage step 3",
|
"multistage step 3",
|
||||||
@@ -368,9 +363,6 @@ add_task(async function test_AWMultistage_Primary_Action() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_AWMultistage_Secondary_Open_URL_Action() {
|
add_task(async function test_AWMultistage_Secondary_Open_URL_Action() {
|
||||||
if (win7Content) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let browser = await openAboutWelcome();
|
let browser = await openAboutWelcome();
|
||||||
let aboutWelcomeActor = await getAboutWelcomeParent(browser);
|
let aboutWelcomeActor = await getAboutWelcomeParent(browser);
|
||||||
const sandbox = sinon.createSandbox();
|
const sandbox = sinon.createSandbox();
|
||||||
@@ -437,11 +429,6 @@ add_task(async function test_AWMultistage_Secondary_Open_URL_Action() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_AWMultistage_Themes() {
|
add_task(async function test_AWMultistage_Themes() {
|
||||||
// No theme screen to test for win7.
|
|
||||||
if (win7Content) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let browser = await openAboutWelcome();
|
let browser = await openAboutWelcome();
|
||||||
let aboutWelcomeActor = await getAboutWelcomeParent(browser);
|
let aboutWelcomeActor = await getAboutWelcomeParent(browser);
|
||||||
|
|
||||||
@@ -588,10 +575,6 @@ add_task(async function test_AWMultistage_can_restore_theme() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_AWMultistage_Import() {
|
add_task(async function test_AWMultistage_Import() {
|
||||||
// No import screen to test for win7.
|
|
||||||
if (win7Content) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let browser = await openAboutWelcome();
|
let browser = await openAboutWelcome();
|
||||||
let aboutWelcomeActor = await getAboutWelcomeParent(browser);
|
let aboutWelcomeActor = await getAboutWelcomeParent(browser);
|
||||||
|
|
||||||
|
|||||||
@@ -257,52 +257,50 @@ add_task(async function test_multistage_aboutwelcome_experimentAPI() {
|
|||||||
sandbox.restore();
|
sandbox.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Test first (theme) screen for non-win7.
|
// Test first (theme) screen.
|
||||||
if (!win7Content) {
|
await test_screen_content(
|
||||||
await test_screen_content(
|
browser,
|
||||||
browser,
|
"multistage step 1",
|
||||||
"multistage step 1",
|
// Expected selectors:
|
||||||
// Expected selectors:
|
[
|
||||||
[
|
"div.onboardingContainer",
|
||||||
"div.onboardingContainer",
|
"main.AW_STEP1",
|
||||||
"main.AW_STEP1",
|
"div.secondary-cta",
|
||||||
"div.secondary-cta",
|
"div.secondary-cta.top",
|
||||||
"div.secondary-cta.top",
|
"button[value='secondary_button']",
|
||||||
"button[value='secondary_button']",
|
"button[value='secondary_button_top']",
|
||||||
"button[value='secondary_button_top']",
|
"label.theme",
|
||||||
"label.theme",
|
"input[type='radio']",
|
||||||
"input[type='radio']",
|
],
|
||||||
],
|
// Unexpected selectors:
|
||||||
// Unexpected selectors:
|
["main.AW_STEP2", "main.AW_STEP3", "div.tiles-container.info"]
|
||||||
["main.AW_STEP2", "main.AW_STEP3", "div.tiles-container.info"]
|
);
|
||||||
);
|
|
||||||
|
|
||||||
await onButtonClick(browser, "button.primary");
|
await onButtonClick(browser, "button.primary");
|
||||||
|
|
||||||
const { callCount } = aboutWelcomeActor.onContentMessage;
|
const { callCount } = aboutWelcomeActor.onContentMessage;
|
||||||
ok(callCount >= 1, `${callCount} Stub was called`);
|
ok(callCount >= 1, `${callCount} Stub was called`);
|
||||||
let clickCall;
|
let clickCall;
|
||||||
for (let i = 0; i < callCount; i++) {
|
for (let i = 0; i < callCount; i++) {
|
||||||
const call = aboutWelcomeActor.onContentMessage.getCall(i);
|
const call = aboutWelcomeActor.onContentMessage.getCall(i);
|
||||||
info(`Call #${i}: ${call.args[0]} ${JSON.stringify(call.args[1])}`);
|
info(`Call #${i}: ${call.args[0]} ${JSON.stringify(call.args[1])}`);
|
||||||
if (call.calledWithMatch("", { event: "CLICK_BUTTON" })) {
|
if (call.calledWithMatch("", { event: "CLICK_BUTTON" })) {
|
||||||
clickCall = call;
|
clickCall = call;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.equal(
|
|
||||||
clickCall.args[0],
|
|
||||||
"AWPage:TELEMETRY_EVENT",
|
|
||||||
"send telemetry event"
|
|
||||||
);
|
|
||||||
|
|
||||||
Assert.equal(
|
|
||||||
clickCall.args[1].message_id,
|
|
||||||
"MY-MOCHITEST-EXPERIMENT_0_AW_STEP1",
|
|
||||||
"Telemetry should join id defined in feature value with screen"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
clickCall.args[0],
|
||||||
|
"AWPage:TELEMETRY_EVENT",
|
||||||
|
"send telemetry event"
|
||||||
|
);
|
||||||
|
|
||||||
|
Assert.equal(
|
||||||
|
clickCall.args[1].message_id,
|
||||||
|
"MY-MOCHITEST-EXPERIMENT_0_AW_STEP1",
|
||||||
|
"Telemetry should join id defined in feature value with screen"
|
||||||
|
);
|
||||||
|
|
||||||
await test_screen_content(
|
await test_screen_content(
|
||||||
browser,
|
browser,
|
||||||
"multistage step 2",
|
"multistage step 2",
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ add_task(async function test_aboutwelcome_mr_template_easy_setup() {
|
|||||||
"default",
|
"default",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
|
if (AppConstants.platform !== "win") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ const { sinon } = ChromeUtils.importESModule(
|
|||||||
);
|
);
|
||||||
// Set the content pref to make it available across tests
|
// Set the content pref to make it available across tests
|
||||||
const ABOUT_WELCOME_OVERRIDE_CONTENT_PREF = "browser.aboutwelcome.screens";
|
const ABOUT_WELCOME_OVERRIDE_CONTENT_PREF = "browser.aboutwelcome.screens";
|
||||||
// Test differently for windows 7 as theme screens are removed.
|
|
||||||
const win7Content = AppConstants.isPlatformAndVersionAtMost("win", "6.1");
|
|
||||||
// Feature callout constants
|
// Feature callout constants
|
||||||
const calloutId = "feature-callout";
|
const calloutId = "feature-callout";
|
||||||
const calloutSelector = `#${calloutId}.featureCallout`;
|
const calloutSelector = `#${calloutId}.featureCallout`;
|
||||||
|
|||||||
@@ -487,11 +487,10 @@ var gMainPane = {
|
|||||||
document.getElementById("dataMigrationGroup").remove();
|
document.getElementById("dataMigrationGroup").remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
// For media control toggle button, we support it on Windows 8.1+ (NT6.3),
|
// For media control toggle button, we support it on Windows, macOS and
|
||||||
// MacOs 10.4+ (darwin8.0, but we already don't support that) and
|
|
||||||
// gtk-based Linux.
|
// gtk-based Linux.
|
||||||
if (
|
if (
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", "6.3") ||
|
AppConstants.platform == "win" ||
|
||||||
AppConstants.platform == "macosx" ||
|
AppConstants.platform == "macosx" ||
|
||||||
AppConstants.MOZ_WIDGET_GTK
|
AppConstants.MOZ_WIDGET_GTK
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ const lazy = {};
|
|||||||
|
|
||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||||
WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyServiceGetter(
|
XPCOMUtils.defineLazyServiceGetter(
|
||||||
@@ -61,26 +60,6 @@ let ShellServiceInternal = {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
isDefaultBrowserOptOut() {
|
|
||||||
if (AppConstants.platform == "win") {
|
|
||||||
let optOutValue = lazy.WindowsRegistry.readRegKey(
|
|
||||||
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Mozilla\\Firefox",
|
|
||||||
"DefaultBrowserOptOut"
|
|
||||||
);
|
|
||||||
lazy.WindowsRegistry.removeRegKey(
|
|
||||||
Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
|
|
||||||
"Software\\Mozilla\\Firefox",
|
|
||||||
"DefaultBrowserOptOut"
|
|
||||||
);
|
|
||||||
if (optOutValue == "True") {
|
|
||||||
Services.prefs.setBoolPref("browser.shell.checkDefaultBrowser", false);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to determine whether or not to show a "Set Default Browser"
|
* Used to determine whether or not to show a "Set Default Browser"
|
||||||
* query dialog. This attribute is true if the application is starting
|
* query dialog. This attribute is true if the application is starting
|
||||||
@@ -99,10 +78,6 @@ let ShellServiceInternal = {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isDefaultBrowserOptOut()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -340,9 +315,9 @@ let ShellServiceInternal = {
|
|||||||
|
|
||||||
// override nsIShellService.setDefaultBrowser() on the ShellService proxy.
|
// override nsIShellService.setDefaultBrowser() on the ShellService proxy.
|
||||||
setDefaultBrowser(forAllUsers) {
|
setDefaultBrowser(forAllUsers) {
|
||||||
// On Windows 10, our best chance is to set UserChoice, so try that first.
|
// On Windows, our best chance is to set UserChoice, so try that first.
|
||||||
if (
|
if (
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", "10") &&
|
AppConstants.platform == "win" &&
|
||||||
lazy.NimbusFeatures.shellService.getVariable(
|
lazy.NimbusFeatures.shellService.getVariable(
|
||||||
"setDefaultBrowserUserChoice"
|
"setDefaultBrowserUserChoice"
|
||||||
)
|
)
|
||||||
@@ -386,7 +361,7 @@ let ShellServiceInternal = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
|
if (AppConstants.platform == "win") {
|
||||||
this.setAsDefaultPDFHandlerUserChoice();
|
this.setAsDefaultPDFHandlerUserChoice();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -46,11 +46,8 @@ var gSetBackground = {
|
|||||||
multiMonitors = monitors.length > 1;
|
multiMonitors = monitors.length > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!multiMonitors) {
|
||||||
!multiMonitors ||
|
// Hide span option on single monitor systems.
|
||||||
AppConstants.isPlatformAndVersionAtMost("win", 6.1)
|
|
||||||
) {
|
|
||||||
// Hide span option if < Win8 since that's when it was introduced.
|
|
||||||
document.getElementById("spanPosition").hidden = true;
|
document.getElementById("spanPosition").hidden = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,11 +49,8 @@ add_task(async function ready() {
|
|||||||
await ExperimentAPI.ready();
|
await ExperimentAPI.ready();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Everything here is Windows 10+.
|
// Everything here is Windows.
|
||||||
Assert.ok(
|
Assert.ok(AppConstants.platform == "win", "Platform is Windows");
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", "10"),
|
|
||||||
"Windows version 10+"
|
|
||||||
);
|
|
||||||
|
|
||||||
add_task(async function remoteEnableWithPDF() {
|
add_task(async function remoteEnableWithPDF() {
|
||||||
let doCleanup = await ExperimentFakes.enrollWithRollout({
|
let doCleanup = await ExperimentFakes.enrollWithRollout({
|
||||||
|
|||||||
@@ -1821,7 +1821,7 @@ export var UITour = {
|
|||||||
|
|
||||||
let canSetDefaultBrowserInBackground = true;
|
let canSetDefaultBrowserInBackground = true;
|
||||||
if (
|
if (
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", "6.2") ||
|
AppConstants.platform == "win" ||
|
||||||
AppConstants.isPlatformAndVersionAtLeast("macosx", "10.10")
|
AppConstants.isPlatformAndVersionAtLeast("macosx", "10.10")
|
||||||
) {
|
) {
|
||||||
canSetDefaultBrowserInBackground = false;
|
canSetDefaultBrowserInBackground = false;
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ this.browserInfo = class extends ExtensionAPI {
|
|||||||
memoryMb,
|
memoryMb,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
|
if (AppConstants.platform == "win") {
|
||||||
data.sec = getSecurityAppData();
|
data.sec = getSecurityAppData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -255,8 +255,8 @@ add_task(condition, async function testInstallationTelemetry() {
|
|||||||
// New timestamp and a check to make sure we can find installed MSIX packages
|
// New timestamp and a check to make sure we can find installed MSIX packages
|
||||||
// by overriding the prefixes a bit further down.
|
// by overriding the prefixes a bit further down.
|
||||||
fullData.install_timestamp = "2";
|
fullData.install_timestamp = "2";
|
||||||
// This check only works on Windows 10 and above
|
// This check only works on Windows
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
|
if (AppConstants.platform == "win") {
|
||||||
fullExtra.other_msix_inst = "true";
|
fullExtra.other_msix_inst = "true";
|
||||||
}
|
}
|
||||||
await writeJsonUtf16(dataFilePath, fullData);
|
await writeJsonUtf16(dataFilePath, fullData);
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ const DUMMY_URL =
|
|||||||
"http://example.com"
|
"http://example.com"
|
||||||
) + "/dummy.html";
|
) + "/dummy.html";
|
||||||
|
|
||||||
const HAS_THREAD_NAMES =
|
|
||||||
AppConstants.platform != "win" ||
|
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", 10);
|
|
||||||
const isFissionEnabled = SpecialPowers.useRemoteSubframes;
|
const isFissionEnabled = SpecialPowers.useRemoteSubframes;
|
||||||
|
|
||||||
const SAMPLE_SIZE = 10;
|
const SAMPLE_SIZE = 10;
|
||||||
@@ -67,13 +64,10 @@ add_task(async function test_proc_info() {
|
|||||||
|
|
||||||
checkProcessCpuTime(parentProc);
|
checkProcessCpuTime(parentProc);
|
||||||
|
|
||||||
// Under Windows, thread names appeared with Windows 10.
|
Assert.ok(
|
||||||
if (HAS_THREAD_NAMES) {
|
parentProc.threads.some(thread => thread.name),
|
||||||
Assert.ok(
|
"At least one of the threads of the parent process is named"
|
||||||
parentProc.threads.some(thread => thread.name),
|
);
|
||||||
"At least one of the threads of the parent process is named"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Assert.ok(parentProc.memory > 0, "Memory was set");
|
Assert.ok(parentProc.memory > 0, "Memory was set");
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { AppConstants } = ChromeUtils.importESModule(
|
|
||||||
"resource://gre/modules/AppConstants.sys.mjs"
|
|
||||||
);
|
|
||||||
const { FormHistory } = ChromeUtils.importESModule(
|
const { FormHistory } = ChromeUtils.importESModule(
|
||||||
"resource://gre/modules/FormHistory.sys.mjs"
|
"resource://gre/modules/FormHistory.sys.mjs"
|
||||||
);
|
);
|
||||||
@@ -805,10 +802,7 @@ add_task(async function unresolvable_server() {
|
|||||||
Assert.equal(result.local[0].value, "Unresolvable Server Entry");
|
Assert.equal(result.local[0].value, "Unresolvable Server Entry");
|
||||||
Assert.equal(result.remote.length, 0);
|
Assert.equal(result.remote.length, 0);
|
||||||
|
|
||||||
// This latency assert fails on Windows 7 (NT version 6.1), so skip it there.
|
assertLatencyHistogram(histogram, true);
|
||||||
if (!AppConstants.isPlatformAndVersionAtMost("win", "6.1")) {
|
|
||||||
assertLatencyHistogram(histogram, true);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Exception handling
|
// Exception handling
|
||||||
|
|||||||
@@ -2081,15 +2081,11 @@ EnvironmentCache.prototype = {
|
|||||||
data = { winPackageFamilyName, ...data };
|
data = { winPackageFamilyName, ...data };
|
||||||
}
|
}
|
||||||
data = { ...this._getProcessData(), ...data };
|
data = { ...this._getProcessData(), ...data };
|
||||||
|
data.sec = this._getSecurityAppData();
|
||||||
} else if (AppConstants.platform == "android") {
|
} else if (AppConstants.platform == "android") {
|
||||||
data.device = this._getDeviceData();
|
data.device = this._getDeviceData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Windows 8+
|
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
|
|
||||||
data.sec = this._getSecurityAppData();
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -696,8 +696,8 @@ export var TelemetryEnvironmentTesting = {
|
|||||||
lazy.Assert.ok(this.checkNullOrString(data.system.appleModelId));
|
lazy.Assert.ok(this.checkNullOrString(data.system.appleModelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This feature is only available on Windows 8+
|
// This feature is only available on Windows
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
|
if (AppConstants.platform == "win") {
|
||||||
lazy.Assert.ok(
|
lazy.Assert.ok(
|
||||||
"sec" in data.system,
|
"sec" in data.system,
|
||||||
"sec must be available under data.system"
|
"sec must be available under data.system"
|
||||||
|
|||||||
@@ -580,20 +580,13 @@ add_task(async function sessionTimeExcludingAndIncludingSuspend() {
|
|||||||
"In test condition, the two uptimes should be close to each other"
|
"In test condition, the two uptimes should be close to each other"
|
||||||
);
|
);
|
||||||
|
|
||||||
// This however should always hold, except on Windows < 10, where the two
|
// This however should always hold.
|
||||||
// clocks are from different system calls, and it can fail in test condition
|
Assert.greaterOrEqual(
|
||||||
// because the machine has not been suspended.
|
withSuspend,
|
||||||
if (
|
withoutSuspend,
|
||||||
AppConstants.platform != "win" ||
|
`The uptime with suspend must always been greater or equal to the uptime
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", "10.0")
|
without suspend`
|
||||||
) {
|
);
|
||||||
Assert.greaterOrEqual(
|
|
||||||
withSuspend,
|
|
||||||
withoutSuspend,
|
|
||||||
`The uptime with suspend must always been greater or equal to the uptime
|
|
||||||
without suspend`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Services.prefs.setBoolPref(
|
Services.prefs.setBoolPref(
|
||||||
"toolkit.telemetry.testing.overrideProductsCheck",
|
"toolkit.telemetry.testing.overrideProductsCheck",
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
|
||||||
import {
|
import {
|
||||||
BaseProcess,
|
BaseProcess,
|
||||||
PromiseWorker,
|
PromiseWorker,
|
||||||
@@ -36,10 +35,7 @@ class WinPromiseWorker extends PromiseWorker {
|
|||||||
|
|
||||||
this.call("init", [
|
this.call("init", [
|
||||||
{
|
{
|
||||||
breakAwayFromJob: !AppConstants.isPlatformAndVersionAtLeast(
|
breakAwayFromJob: false,
|
||||||
"win",
|
|
||||||
"6.2"
|
|
||||||
),
|
|
||||||
comspec: Services.env.get("COMSPEC"),
|
comspec: Services.env.get("COMSPEC"),
|
||||||
signalEvent: String(
|
signalEvent: String(
|
||||||
ctypes.cast(this.signalEvent, ctypes.uintptr_t).value
|
ctypes.cast(this.signalEvent, ctypes.uintptr_t).value
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ add_task(async function test_subprocess_invalid_json() {
|
|||||||
equal(exitCode, 0, "Got expected exit code");
|
equal(exitCode, 0, "Got expected exit code");
|
||||||
});
|
});
|
||||||
|
|
||||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "6")) {
|
if (AppConstants.platform == "win") {
|
||||||
add_task(async function test_subprocess_inherited_descriptors() {
|
add_task(async function test_subprocess_inherited_descriptors() {
|
||||||
let { libc, win32 } = ChromeUtils.importESModule(
|
let { libc, win32 } = ChromeUtils.importESModule(
|
||||||
"resource://gre/modules/subprocess/subprocess_win.sys.mjs"
|
"resource://gre/modules/subprocess/subprocess_win.sys.mjs"
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ add_task(async function testEmeSupport() {
|
|||||||
let item = getAddonCard(win, addon.id);
|
let item = getAddonCard(win, addon.id);
|
||||||
if (addon.id == WIDEVINE_ID) {
|
if (addon.id == WIDEVINE_ID) {
|
||||||
if (
|
if (
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", "6") ||
|
AppConstants.platform == "win" ||
|
||||||
AppConstants.platform == "macosx" ||
|
AppConstants.platform == "macosx" ||
|
||||||
AppConstants.platform == "linux"
|
AppConstants.platform == "linux"
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user