diff options
Diffstat (limited to 'browser/components/asrouter')
15 files changed, 172 insertions, 131 deletions
diff --git a/browser/components/asrouter/content-src/styles/_feature-callout.scss b/browser/components/asrouter/content-src/styles/_feature-callout.scss index 40137fd29a..8a1b96db6f 100644 --- a/browser/components/asrouter/content-src/styles/_feature-callout.scss +++ b/browser/components/asrouter/content-src/styles/_feature-callout.scss @@ -359,7 +359,7 @@ inset-inline: auto 0; margin-block: 16px 0; margin-inline: 0 16px; - background-color: var(--fc-background); + background-color: transparent; &[button-size='small'] { height: 24px; diff --git a/browser/components/asrouter/content/asrouter-admin.bundle.js b/browser/components/asrouter/content/asrouter-admin.bundle.js index e5a1e6dd6a..aa5989ca29 100644 --- a/browser/components/asrouter/content/asrouter-admin.bundle.js +++ b/browser/components/asrouter/content/asrouter-admin.bundle.js @@ -335,6 +335,11 @@ for (const type of [ "UPDATE_SEARCH_SHORTCUTS", "UPDATE_SECTION_PREFS", "WALLPAPERS_SET", + "WALLPAPER_CLICK", + "WEATHER_IMPRESSION", + "WEATHER_LOAD_ERROR", + "WEATHER_OPEN_PROVIDER_URL", + "WEATHER_UPDATE", "WEBEXT_CLICK", "WEBEXT_DISMISS", ]) { diff --git a/browser/components/asrouter/content/components/ASRouterAdmin/ASRouterAdmin.css b/browser/components/asrouter/content/components/ASRouterAdmin/ASRouterAdmin.css index de14572006..2e16438917 100644 --- a/browser/components/asrouter/content/components/ASRouterAdmin/ASRouterAdmin.css +++ b/browser/components/asrouter/content/components/ASRouterAdmin/ASRouterAdmin.css @@ -11,6 +11,16 @@ --newtab-text-secondary-color: color-mix(in srgb, var(--newtab-text-primary-color) 70%, transparent); --newtab-element-hover-color: color-mix(in srgb, var(--newtab-background-color) 90%, #000); --newtab-element-active-color: color-mix(in srgb, var(--newtab-background-color) 80%, #000); + --newtab-button-background: var(--button-background-color); + --newtab-button-focus-background: var(--newtab-button-background); + --newtab-button-focus-border: var(--focus-outline-color); + --newtab-button-hover-background: var(--button-background-color-hover); + --newtab-button-active-background: var(--button-background-color-active); + --newtab-button-text: var(--button-text-color); + --newtab-button-static-background: #F0F0F4; + --newtab-button-static-focus-background: var(--newtab-button-static-background); + --newtab-button-static-hover-background: #E0E0E6; + --newtab-button-static-active-background: #CFCFD8; --newtab-element-secondary-color: color-mix(in srgb, currentColor 5%, transparent); --newtab-element-secondary-hover-color: color-mix(in srgb, currentColor 12%, transparent); --newtab-element-secondary-active-color: color-mix(in srgb, currentColor 25%, transparent); @@ -48,6 +58,9 @@ --newtab-primary-element-text-color: rgb(43, 42, 51); --newtab-wordmark-color: rgb(251, 251, 254); --newtab-status-success: #7C6; + --newtab-button-static-background: #2B2A33; + --newtab-button-static-hover-background: #52525E; + --newtab-button-static-active-background: #5B5B66; } @media (prefers-contrast) { @@ -61,7 +74,7 @@ background-size: 16px; -moz-context-properties: fill; display: inline-block; - color: var(--newtab-text-primary-color); + color: var(--icon-color); fill: currentColor; height: 16px; vertical-align: middle; @@ -111,6 +124,9 @@ .icon.icon-info { background-image: url("chrome://global/skin/icons/info.svg"); } +.icon.icon-info-critical { + background-image: url("chrome://activity-stream/content/data/content/assets/glyph-info-critical-16.svg"); +} .icon.icon-help { background-image: url("chrome://global/skin/icons/help.svg"); } @@ -191,6 +207,9 @@ .icon.icon-webextension { background-image: url("chrome://activity-stream/content/data/content/assets/glyph-webextension-16.svg"); } +.icon.icon-weather { + background-image: url("chrome://browser/skin/weather/sunny.svg"); +} .icon.icon-highlights { background-image: url("chrome://global/skin/icons/highlights.svg"); } diff --git a/browser/components/asrouter/docs/targeting-attributes.md b/browser/components/asrouter/docs/targeting-attributes.md index b0049a4f1b..cabcd661f8 100644 --- a/browser/components/asrouter/docs/targeting-attributes.md +++ b/browser/components/asrouter/docs/targeting-attributes.md @@ -34,7 +34,6 @@ Please note that some targeting attributes require stricter controls on the tele * [hasMigratedPasswords](#hasmigratedpasswords) * [hasPinnedTabs](#haspinnedtabs) * [homePageSettings](#homepagesettings) -* [inMr2022Holdback](#inmr2022holdback) * [isBackgroundTaskMode](#isbackgroundtaskmode) * [isChinaRepack](#ischinarepack) * [isDefaultBrowser](#isdefaultbrowser) @@ -43,6 +42,7 @@ Please note that some targeting attributes require stricter controls on the tele * [isFxAEnabled](#isfxaenabled) * [isFxASignedIn](#isFxASignedIn) * [isMajorUpgrade](#ismajorupgrade) +* [isMSIX](#ismsix) * [isRTAMO](#isrtamo) * [launchOnLoginEnabled](#launchonloginenabled) * [locale](#locale) @@ -972,10 +972,6 @@ mode, or `null` if this invocation is not running in background task mode. Checks if user prefers reduced motion as indicated by the value of a media query for `prefers-reduced-motion`. -### `inMr2022Holdback` - -A boolean. `true` when the user is in the Major Release 2022 holdback study. - ### `distributionId` A string containing the id of the distribution, or the empty string if there @@ -1009,6 +1005,10 @@ A boolean. `true` if the user is configured to use the embedded Migration Wizard A boolean. `true` when [RTAMO](first-run.md#return-to-amo-rtamo) has been used to download Firefox, `false` otherwise. +### `isMSIX` + +A boolean. `true` when hasPackageId is `true` on Windows, `false` otherwise. + ### `isDeviceMigration` A boolean. `true` when [support.mozilla.org](https://support.mozilla.org) has been used to download the browser as part of a "migration" campaign, for device migration guidance, `false` otherwise. diff --git a/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs b/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs index 9773eda270..2761481ceb 100644 --- a/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs +++ b/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs @@ -45,7 +45,6 @@ ChromeUtils.defineESModuleGetters(lazy, { ClientEnvironment: "resource://normandy/lib/ClientEnvironment.sys.mjs", CustomizableUI: "resource:///modules/CustomizableUI.sys.mjs", HomePage: "resource:///modules/HomePage.sys.mjs", - NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", ProfileAge: "resource://gre/modules/ProfileAge.sys.mjs", Region: "resource://gre/modules/Region.sys.mjs", TargetingContext: "resource://messaging-system/targeting/Targeting.sys.mjs", @@ -847,6 +846,19 @@ const TargetingGetters = { return lazy.WindowsLaunchOnLogin.getLaunchOnLoginEnabled(); }, + get isMSIX() { + if (AppConstants.platform !== "win") { + return false; + } + // While we can write registry keys using external programs, we have no + // way of cleanup on uninstall. If we are on an MSIX build + // launch on login should never be enabled. + // Default to false so that the feature isn't unnecessarily + // disabled. + // See Bug 1888263. + return Services.sysinfo.getProperty("hasWinPackageId", false); + }, + /** * Is this invocation running in background task mode? * @@ -879,15 +891,6 @@ const TargetingGetters = { }, /** - * Whether or not the user is in the Major Release 2022 holdback study. - */ - get inMr2022Holdback() { - return ( - lazy.NimbusFeatures.majorRelease2022.getVariable("onboarding") === false - ); - }, - - /** * The distribution id, if any. * @return {string} */ diff --git a/browser/components/asrouter/modules/CFRMessageProvider.sys.mjs b/browser/components/asrouter/modules/CFRMessageProvider.sys.mjs index e0aa49ad49..c80ae323ab 100644 --- a/browser/components/asrouter/modules/CFRMessageProvider.sys.mjs +++ b/browser/components/asrouter/modules/CFRMessageProvider.sys.mjs @@ -811,6 +811,74 @@ const CFR_MESSAGES = [ }, trigger: { id: "preferenceObserver", params: ["foo.bar"] }, }, + { + id: "FACEBOOK_CONTAINER_ADDON_A", + template: "cfr_doorhanger", + groups: ["cfr"], + content: { + layout: "addon_recommendation", + category: "cfrAddons", + bucket_id: "CFR", + anchor_id: "PanelUI-menu-button", + skip_address_bar_notifier: true, + icon_class: "cfr-doorhanger-medium-icon", + notification_text: { + string_id: "cfr-doorhanger-extension-notification2", + }, + heading_text: { + string_id: "cfr-doorhanger-extension-heading", + }, + info_icon: { + label: { + string_id: "cfr-doorhanger-extension-sumo-link", + }, + sumo_path: "extensionrecommendations", + }, + addon: { + id: "954390", + title: "Facebook Container", + icon: "https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-images/03c866df-82ea-489c-83c7-df6d0662d893.svg", + rating: "4.5", + users: "1.1M", + author: "Mozilla", + amo_url: "https://addons.mozilla.org/firefox/addon/facebook-container/", + }, + text: "Make it harder for Facebook to track your browsing activity, including info from medical and financial sites.", + buttons: { + primary: { + label: { + string_id: "firefoxview-cfr-primarybutton", + }, + action: { + type: "INSTALL_ADDON_FROM_URL", + data: { + url: "https://example.com", + telemetrySource: "amo", + }, + }, + }, + secondary: [ + { + label: { + string_id: "firefoxview-cfr-secondarybutton", + }, + action: { + type: "CANCEL", + }, + }, + ], + }, + }, + frequency: { + lifetime: 1, + }, + targeting: + "!('@contain-facebook' in addonsInfo.addons|keys) && !('@testpilot-containers' in addonsInfo.addons|keys) && ('browser.discovery.enabled'|preferenceValue)", + trigger: { + id: "openURL", + params: ["www.facebook.com", "facebook.com"], + }, + }, ]; export const CFRMessageProvider = { diff --git a/browser/components/asrouter/modules/FeatureCallout.sys.mjs b/browser/components/asrouter/modules/FeatureCallout.sys.mjs index 5f0e266a4e..e8732b213d 100644 --- a/browser/components/asrouter/modules/FeatureCallout.sys.mjs +++ b/browser/components/asrouter/modules/FeatureCallout.sys.mjs @@ -462,6 +462,10 @@ export class FeatureCallout { * the callout should be aligned with which point on the anchor element. * @property {PopupAttachmentPoint} anchor_attachment * @property {PopupAttachmentPoint} callout_attachment + * @property {String} [panel_position_string] The attachments joined into a + * string, e.g. "bottomleft topright". Passed to XULPopupElement::openPopup. + * This is not provided by JSON, but generated from anchor_attachment and + * callout_attachment. * @property {Number} [offset_x] Offset in pixels to apply to the callout * position in the horizontal direction. * @property {Number} [offset_y] The same in the vertical direction. @@ -514,8 +518,10 @@ export class FeatureCallout { */ /** - * @typedef {Object} AnchorConfig + * @typedef {Object} Anchor * @property {String} selector CSS selector for the anchor node. + * @property {Element} [element] The anchor node resolved from the selector. + * Not provided by JSON, but generated dynamically. * @property {PanelPosition} [panel_position] Used to show the callout in a * XUL panel. Only works in chrome documents, like the main browser window. * @property {HTMLArrowPosition} [arrow_position] Used to show the callout in @@ -533,27 +539,13 @@ export class FeatureCallout { */ /** - * @typedef {Object} Anchor - * @property {String} selector - * @property {PanelPosition} [panel_position] - * @property {HTMLArrowPosition} [arrow_position] - * @property {PositionOverride} [absolute_position] - * @property {Boolean} [hide_arrow] - * @property {Boolean} [no_open_on_anchor] - * @property {Number} [arrow_width] - * @property {Element} element The anchor node resolved from the selector. - * @property {String} [panel_position_string] The panel_position joined into a - * string, e.g. "bottomleft topright". Passed to XULPopupElement::openPopup. - */ - - /** * Return the first visible anchor element for the current screen. Screens can * specify multiple anchors in an array, and the first one that is visible * will be used. If none are visible, return null. * @returns {Anchor|null} */ _getAnchor() { - /** @type {AnchorConfig[]} */ + /** @type {Anchor[]} */ const anchors = Array.isArray(this.currentScreen?.anchors) ? this.currentScreen.anchors : []; @@ -565,9 +557,9 @@ export class FeatureCallout { continue; } const { selector, arrow_position, panel_position } = anchor; - let panel_position_string; if (panel_position) { - panel_position_string = this._getPanelPositionString(panel_position); + let panel_position_string = + this._getPanelPositionString(panel_position); // if the positionString doesn't match the format we expect, don't // render the callout. if (!panel_position_string && !arrow_position) { @@ -580,6 +572,7 @@ export class FeatureCallout { ); continue; } + panel_position.panel_position_string = panel_position_string; } if ( arrow_position && @@ -637,7 +630,7 @@ export class FeatureCallout { continue; } } - return { ...anchor, panel_position_string, element }; + return { ...anchor, element }; } return null; } @@ -752,13 +745,10 @@ export class FeatureCallout { } const { autohide, padding } = this.currentScreen.content; - const { - panel_position_string, - hide_arrow, - no_open_on_anchor, - arrow_width, - } = anchor; - const needsPanel = "MozXULElement" in this.win && !!panel_position_string; + const { panel_position, hide_arrow, no_open_on_anchor, arrow_width } = + anchor; + const needsPanel = + "MozXULElement" in this.win && !!panel_position?.panel_position_string; if (this._container) { if (needsPanel ^ (this._container?.localName === "panel")) { @@ -775,7 +765,7 @@ export class FeatureCallout { noautofocus="true" flip="slide" type="arrow" - position="${panel_position_string}" + position="${panel_position.panel_position_string}" ${hide_arrow ? "" : 'show-arrow=""'} ${autohide ? "" : 'noautohide="true"'} ${no_open_on_anchor ? 'no-open-on-anchor=""' : ""} @@ -1742,17 +1732,21 @@ export class FeatureCallout { }); } else if (this._container.localName === "panel") { const anchor = this._getAnchor(); - if (!anchor) { + if (!anchor?.panel_position) { this.endTour(); return; } - const position = anchor.panel_position_string; + const { + panel_position_string: position, + offset_x: x, + offset_y: y, + } = anchor.panel_position; this._container.addEventListener("popupshown", onRender, { once: true, }); this._container.addEventListener("popuphiding", this); this._addPanelConflictListeners(); - this._container.openPopup(anchor.element, { position }); + this._container.openPopup(anchor.element, { position, x, y }); } } }); diff --git a/browser/components/asrouter/modules/FeatureCalloutMessages.sys.mjs b/browser/components/asrouter/modules/FeatureCalloutMessages.sys.mjs index 38c9a8d848..4fda4355bf 100644 --- a/browser/components/asrouter/modules/FeatureCalloutMessages.sys.mjs +++ b/browser/components/asrouter/modules/FeatureCalloutMessages.sys.mjs @@ -157,7 +157,7 @@ const MESSAGES = () => { // Add the highest possible cap to ensure impressions are recorded while allowing the Spotlight to sync across windows/tabs with Firefox View open lifetime: 100, }, - targeting: `!inMr2022Holdback && source == "about:firefoxview" && + targeting: `source == "about:firefoxview" && !'browser.newtabpage.activity-stream.asrouter.providers.cfr'|preferenceIsUserSet && 'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features'|preferenceValue && ${matchCurrentScreenTargeting( @@ -303,7 +303,7 @@ const MESSAGES = () => { ], }, priority: 3, - targeting: `!inMr2022Holdback && source == "about:firefoxview" && ${matchCurrentScreenTargeting( + targeting: `source == "about:firefoxview" && ${matchCurrentScreenTargeting( FIREFOX_VIEW_PREF, "FEATURE_CALLOUT_[0-9]" )} && ${matchIncompleteTargeting(FIREFOX_VIEW_PREF)}`, @@ -376,7 +376,7 @@ const MESSAGES = () => { ], }, priority: 2, - targeting: `!inMr2022Holdback && source == "about:firefoxview" && "browser.firefox-view.view-count" | preferenceValue > 2 + targeting: `source == "about:firefoxview" && "browser.firefox-view.view-count" | preferenceValue > 2 && (("identity.fxaccounts.enabled" | preferenceValue == false) || !(("services.sync.engine.tabs" | preferenceValue == true) && ("services.sync.username" | preferenceValue))) && (!messageImpressions.FIREFOX_VIEW_SPOTLIGHT[messageImpressions.FIREFOX_VIEW_SPOTLIGHT | length - 1] || messageImpressions.FIREFOX_VIEW_SPOTLIGHT[messageImpressions.FIREFOX_VIEW_SPOTLIGHT | length - 1] < currentDate|date - ${ONE_DAY_IN_MS})`, frequency: { lifetime: 1, diff --git a/browser/components/asrouter/modules/OnboardingMessageProvider.sys.mjs b/browser/components/asrouter/modules/OnboardingMessageProvider.sys.mjs index 3cfbbb3f34..298599e42b 100644 --- a/browser/components/asrouter/modules/OnboardingMessageProvider.sys.mjs +++ b/browser/components/asrouter/modules/OnboardingMessageProvider.sys.mjs @@ -24,7 +24,6 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", - NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", ShellService: "resource:///modules/ShellService.sys.mjs", }); @@ -52,7 +51,6 @@ const L10N = new Localization([ "branding/brand.ftl", "browser/newtab/onboarding.ftl", "toolkit/branding/brandings.ftl", - "toolkit/branding/accounts.ftl", ]); const HOMEPAGE_PREF = "browser.startup.homepage"; @@ -872,7 +870,7 @@ const BASE_MESSAGES = () => [ ], lifetime: 12, }, - targeting: "!inMr2022Holdback && doesAppNeedPrivatePin", + targeting: "doesAppNeedPrivatePin", }, { id: "PB_NEWTAB_COOKIE_BANNERS_PROMO", @@ -988,7 +986,7 @@ const BASE_MESSAGES = () => [ targeting: `source == 'newtab' && 'browser.startup.windowsLaunchOnLogin.disableLaunchOnLoginPrompt'|preferenceValue == false && 'browser.startup.windowsLaunchOnLogin.enabled'|preferenceValue == true && isDefaultBrowser && !activeNotifications - && !launchOnLoginEnabled`, + && !launchOnLoginEnabled && !isMSIX`, }, { id: "INFOBAR_LAUNCH_ON_LOGIN_FINAL", @@ -1056,7 +1054,7 @@ const BASE_MESSAGES = () => [ && messageImpressions.INFOBAR_LAUNCH_ON_LOGIN[messageImpressions.INFOBAR_LAUNCH_ON_LOGIN | length - 1] && messageImpressions.INFOBAR_LAUNCH_ON_LOGIN[messageImpressions.INFOBAR_LAUNCH_ON_LOGIN | length - 1] < currentDate|date - ${FOURTEEN_DAYS_IN_MS} - && !launchOnLoginEnabled`, + && !launchOnLoginEnabled && !isMSIX`, }, { id: "FOX_DOODLE_SET_DEFAULT", @@ -1375,9 +1373,8 @@ export const OnboardingMessageProvider = { return checkDefault && !isDefault; }, _shouldShowPrivacySegmentationScreen() { - // Fall back to pref: browser.privacySegmentation.preferences.show - return lazy.NimbusFeatures.majorRelease2022.getVariable( - "feltPrivacyShowPreferencesSection" + return Services.prefs.getBoolPref( + "browser.privacySegmentation.preferences.show" ); }, _doesHomepageNeedReset() { diff --git a/browser/components/asrouter/modules/PanelTestProvider.sys.mjs b/browser/components/asrouter/modules/PanelTestProvider.sys.mjs index 5180e2e6a2..8dbb718bfd 100644 --- a/browser/components/asrouter/modules/PanelTestProvider.sys.mjs +++ b/browser/components/asrouter/modules/PanelTestProvider.sys.mjs @@ -37,7 +37,7 @@ const MESSAGES = () => [ }, sumo_path: "https://example.com", }, - text: { string_id: "cfr-doorhanger-bookmark-fxa-body" }, + text: { string_id: "cfr-doorhanger-bookmark-fxa-body-2" }, icon: "chrome://branding/content/icon64.png", icon_class: "cfr-doorhanger-large-icon", persistent_doorhanger: true, diff --git a/browser/components/asrouter/modules/RemoteL10n.sys.mjs b/browser/components/asrouter/modules/RemoteL10n.sys.mjs index 1df10fbd72..4135d77191 100644 --- a/browser/components/asrouter/modules/RemoteL10n.sys.mjs +++ b/browser/components/asrouter/modules/RemoteL10n.sys.mjs @@ -204,7 +204,6 @@ export class _RemoteL10n { "branding/brand.ftl", "browser/defaultBrowserNotification.ftl", "browser/newtab/asrouter.ftl", - "toolkit/branding/accounts.ftl", "toolkit/branding/brandings.ftl", ], false diff --git a/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js b/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js index b80b3ec7a4..a01b2cf14c 100644 --- a/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js +++ b/browser/components/asrouter/tests/browser/browser_asrouter_infobar.js @@ -107,7 +107,7 @@ add_task(async function react_to_trigger() { "Notification has default priority" ); // Dismiss the notification - notificationStack.currentNotification.closeButtonEl.click(); + notificationStack.currentNotification.closeButton.click(); }); add_task(async function dismiss_telemetry() { @@ -128,7 +128,7 @@ add_task(async function dismiss_telemetry() { // Remove any IMPRESSION pings dispatchStub.reset(); - infobar.notification.closeButtonEl.click(); + infobar.notification.closeButton.click(); await BrowserTestUtils.waitForCondition( () => infobar.notification === null, @@ -204,7 +204,7 @@ add_task(async function prevent_multiple_messages() { Assert.equal(dispatchStub.callCount, 2, "Impression count did not increase"); // Dismiss the first notification - infobar.notification.closeButtonEl.click(); + infobar.notification.closeButton.click(); Assert.equal(InfoBar._activeInfobar, null, "Cleared the active notification"); // Reset impressions count @@ -218,6 +218,6 @@ add_task(async function prevent_multiple_messages() { Assert.ok(InfoBar._activeInfobar, "activeInfobar is set"); Assert.equal(dispatchStub.callCount, 2, "Called twice with IMPRESSION"); // Dismiss the notification again - infobar.notification.closeButtonEl.click(); + infobar.notification.closeButton.click(); Assert.equal(InfoBar._activeInfobar, null, "Cleared the active notification"); }); diff --git a/browser/components/asrouter/tests/browser/browser_asrouter_targeting.js b/browser/components/asrouter/tests/browser/browser_asrouter_targeting.js index 55f278fd7d..e20a75c5ab 100644 --- a/browser/components/asrouter/tests/browser/browser_asrouter_targeting.js +++ b/browser/components/asrouter/tests/browser/browser_asrouter_targeting.js @@ -1226,47 +1226,6 @@ add_task(async function check_userPrefersReducedMotion() { ); }); -add_task(async function test_mr2022Holdback() { - await ExperimentAPI.ready(); - - ok( - !ASRouterTargeting.Environment.inMr2022Holdback, - "Should not be in holdback (no experiment)" - ); - - { - const doExperimentCleanup = await ExperimentFakes.enrollWithFeatureConfig({ - featureId: "majorRelease2022", - value: { - onboarding: true, - }, - }); - - ok( - !ASRouterTargeting.Environment.inMr2022Holdback, - "Should not be in holdback (onboarding = true)" - ); - - await doExperimentCleanup(); - } - - { - const doExperimentCleanup = await ExperimentFakes.enrollWithFeatureConfig({ - featureId: "majorRelease2022", - value: { - onboarding: false, - }, - }); - - ok( - ASRouterTargeting.Environment.inMr2022Holdback, - "Should be in holdback (onboarding = false)" - ); - - await doExperimentCleanup(); - } -}); - add_task(async function test_distributionId() { is( ASRouterTargeting.Environment.distributionId, @@ -1469,6 +1428,28 @@ add_task(async function check_useEmbeddedMigrationWizard() { ok(!(await ASRouterTargeting.Environment.useEmbeddedMigrationWizard)); }); +add_task(async function check_isMSIX() { + is( + typeof ASRouterTargeting.Environment.isMSIX, + "boolean", + "Should return a boolean" + ); + if (AppConstants.platform !== "win") { + is( + ASRouterTargeting.Environment.isMSIX, + false, + "Should always be false on non-Windows" + ); + return; + } + + is( + ASRouterTargeting.Environment.isMSIX, + Services.sysinfo.getProperty("hasWinPackageId"), + "Should match the value from sysinfo" + ); +}); + add_task(async function check_isRTAMO() { is( typeof ASRouterTargeting.Environment.isRTAMO, diff --git a/browser/components/asrouter/tests/unit/CFRMessageProvider.test.js b/browser/components/asrouter/tests/unit/CFRMessageProvider.test.js index fe6959852c..ec35806d11 100644 --- a/browser/components/asrouter/tests/unit/CFRMessageProvider.test.js +++ b/browser/components/asrouter/tests/unit/CFRMessageProvider.test.js @@ -1,32 +1,9 @@ import { CFRMessageProvider } from "modules/CFRMessageProvider.sys.mjs"; -const REGULAR_IDS = [ - "FACEBOOK_CONTAINER", - "GOOGLE_TRANSLATE", - "YOUTUBE_ENHANCE", - // These are excluded for now. - // "WIKIPEDIA_CONTEXT_MENU_SEARCH", - // "REDDIT_ENHANCEMENT", -]; - describe("CFRMessageProvider", () => { let messages; beforeEach(async () => { messages = await CFRMessageProvider.getMessages(); }); - it("should have a total of 11 messages", () => { - assert.lengthOf(messages, 11); - }); - it("should have one message each for the three regular addons", () => { - for (const id of REGULAR_IDS) { - const cohort3 = messages.find(msg => msg.id === `${id}_3`); - assert.ok(cohort3, `contains three day cohort for ${id}`); - assert.deepEqual( - cohort3.frequency, - { lifetime: 3 }, - "three day cohort has the right frequency cap" - ); - assert.notInclude(cohort3.targeting, `providerCohorts.cfr`); - } - }); + it("should have messages", () => assert.ok(messages.length)); }); diff --git a/browser/components/asrouter/tests/unit/RemoteL10n.test.js b/browser/components/asrouter/tests/unit/RemoteL10n.test.js index dd0f858750..0e32442522 100644 --- a/browser/components/asrouter/tests/unit/RemoteL10n.test.js +++ b/browser/components/asrouter/tests/unit/RemoteL10n.test.js @@ -81,7 +81,6 @@ describe("RemoteL10n", () => { "branding/brand.ftl", "browser/defaultBrowserNotification.ftl", "browser/newtab/asrouter.ftl", - "toolkit/branding/accounts.ftl", "toolkit/branding/brandings.ftl", ]); assert.isFalse(args[1]); @@ -103,7 +102,6 @@ describe("RemoteL10n", () => { "branding/brand.ftl", "browser/defaultBrowserNotification.ftl", "browser/newtab/asrouter.ftl", - "toolkit/branding/accounts.ftl", "toolkit/branding/brandings.ftl", ]); assert.isFalse(args[1]); |