Bug 1839431 - [about:welcome] Make Embedded Migration wizard default in Fx117 r=omc-reviewers,pdahiya

Differential Revision: https://phabricator.services.mozilla.com/D181788
This commit is contained in:
negin 2023-07-11 14:08:21 +00:00
Родитель a3852ea8db
Коммит df85744830
6 изменённых файлов: 166 добавлений и 21 удалений

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

@ -2172,8 +2172,8 @@ pref("browser.migrate.vivaldi.enabled", true);
pref("browser.migrate.content-modal.enabled", true);
pref("browser.migrate.content-modal.import-all.enabled", true);
// Values can be: "default", "autoclose", "standalone", "legacy".
pref("browser.migrate.content-modal.about-welcome-behavior", "legacy");
// Values can be: "default", "autoclose", "standalone", "legacy", "embedded".
pref("browser.migrate.content-modal.about-welcome-behavior", "embedded");
// The maximum age of history entries we'll import, in days.
pref("browser.migrate.history.maxAgeInDays", 180);

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

@ -87,7 +87,89 @@ const MR_ABOUT_WELCOME_DEFAULT = {
{
id: "AW_EASY_SETUP",
targeting:
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin",
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && !useEmbeddedMigrationWizard",
content: {
position: "split",
split_narrow_bkg_position: "-60px",
image_alt_text: {
string_id: "mr2022-onboarding-default-image-alt",
},
background:
"url('chrome://activity-stream/content/data/content/assets/mr-settodefault.svg') var(--mr-secondary-position) no-repeat var(--mr-screen-background-color)",
progress_bar: true,
logo: {},
title: { string_id: "mr2022-onboarding-set-default-title" },
subtitle: {
string_id: "mr2022-onboarding-set-default-subtitle",
},
tiles: {
type: "multiselect",
data: [
{
id: "checkbox-1",
defaultValue: true,
label: {
string_id:
"mr2022-onboarding-easy-setup-set-default-checkbox-label",
},
action: {
type: "SET_DEFAULT_BROWSER",
},
},
{
id: "checkbox-2",
defaultValue: true,
label: {
string_id: "mr2022-onboarding-easy-setup-import-checkbox-label",
},
action: {
type: "SHOW_MIGRATION_WIZARD",
data: {},
},
},
],
},
primary_button: {
label: {
string_id: "mr2022-onboarding-easy-setup-primary-button-label",
},
action: {
type: "MULTI_ACTION",
collectSelect: true,
navigate: true,
data: {
actions: [],
},
},
},
secondary_button: {
label: {
string_id: "mr2022-onboarding-secondary-skip-button-label",
},
action: {
navigate: true,
},
has_arrow_icon: true,
},
secondary_button_top: {
label: {
string_id: "mr1-onboarding-sign-in-button-label",
},
action: {
data: {
entrypoint: "activity-stream-firstrun",
where: "tab",
},
type: "SHOW_FIREFOX_ACCOUNTS",
addFlowParams: true,
},
},
},
},
{
id: "AW_EASY_SETUP_EMBEDDED",
targeting:
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && useEmbeddedMigrationWizard",
content: {
position: "split",
split_narrow_bkg_position: "-60px",
@ -124,9 +206,36 @@ const MR_ABOUT_WELCOME_DEFAULT = {
label: {
string_id: "mr2022-onboarding-easy-setup-import-checkbox-label",
},
action: {
type: "SHOW_MIGRATION_WIZARD",
data: {},
uncheckedAction: {
type: "MULTI_ACTION",
data: {
actions: [
{
type: "SET_PREF",
data: {
pref: {
name: "showEmbeddedImport",
},
},
},
],
},
},
checkedAction: {
type: "MULTI_ACTION",
data: {
actions: [
{
type: "SET_PREF",
data: {
pref: {
name: "showEmbeddedImport",
value: true,
},
},
},
],
},
},
},
],
@ -344,8 +453,7 @@ const MR_ABOUT_WELCOME_DEFAULT = {
},
{
id: "AW_IMPORT_SETTINGS_EMBEDDED",
targeting:
"!(os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin) && useEmbeddedMigrationWizard",
targeting: `(!(os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin) || ("messaging-system-action.showEmbeddedImport" |preferenceValue == true) && useEmbeddedMigrationWizard`,
content: {
tiles: { type: "migration-wizard" },
position: "split",

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

@ -46,7 +46,8 @@ async function openAboutWelcome() {
await pushPrefs(
// Speed up the tests by disabling transitions.
["browser.aboutwelcome.transitions", false],
["intl.multilingual.aboutWelcome.languageMismatchEnabled", true]
["intl.multilingual.aboutWelcome.languageMismatchEnabled", true],
["browser.migrate.content-modal.about-welcome-behavior", "default"]
);
await setAboutWelcomePref(true);
@ -61,7 +62,11 @@ async function openAboutWelcome() {
.stub(AWScreenUtils, "evaluateScreenTargeting")
.resolves(true)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin"
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && !useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs("isDeviceMigration")

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

@ -95,7 +95,11 @@ add_task(async function test_aboutwelcome_pin_screen_impression() {
.stub(AWScreenUtils, "evaluateScreenTargeting")
.resolves(true)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin"
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && !useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs("isDeviceMigration")
@ -157,7 +161,11 @@ add_task(async function test_aboutwelcome_mr_template_content() {
.stub(AWScreenUtils, "evaluateScreenTargeting")
.resolves(true)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin"
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && !useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs("isDeviceMigration")
@ -214,7 +222,11 @@ add_task(async function test_aboutwelcome_mr_template_content_pin() {
.stub(AWScreenUtils, "evaluateScreenTargeting")
.resolves(true)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin"
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && !useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs("isDeviceMigration")
@ -258,7 +270,11 @@ add_task(async function test_aboutwelcome_mr_template_only_default() {
.stub(AWScreenUtils, "evaluateScreenTargeting")
.resolves(true)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin"
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && !useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs("isDeviceMigration")
@ -291,7 +307,11 @@ add_task(async function test_aboutwelcome_mr_template_get_started() {
.stub(AWScreenUtils, "evaluateScreenTargeting")
.resolves(true)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin"
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs(
"os.windowsBuildNumber >= 15063 && !isDefaultBrowser && !doesAppNeedPin && !useEmbeddedMigrationWizard"
)
.resolves(false)
.withArgs("isDeviceMigration")

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

@ -118,6 +118,11 @@ add_task(async function second_screen_filtered_by_targeting() {
* not set as default and Windows 10 version 1703
*/
add_task(async function test_aboutwelcome_mr_template_easy_setup() {
await pushPrefs([
"browser.migrate.content-modal.about-welcome-behavior",
"default",
]);
if (!AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
return;
}

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

@ -279,6 +279,7 @@ describe("MultiStageAboutWelcomeProton module", () => {
it("should have 'pin' button by default", async () => {
const data = await prepConfig({ needPin: true }, [
"AW_EASY_SETUP",
"AW_EASY_SETUP_EMBEDDED",
"AW_WELCOME_BACK",
]);
assert.propertyVal(
@ -293,7 +294,7 @@ describe("MultiStageAboutWelcomeProton module", () => {
needDefault: true,
needPin: true,
},
["AW_EASY_SETUP", "AW_WELCOME_BACK"]
["AW_EASY_SETUP", "AW_EASY_SETUP_EMBEDDED", "AW_WELCOME_BACK"]
);
assert.propertyVal(
@ -303,34 +304,40 @@ describe("MultiStageAboutWelcomeProton module", () => {
);
assert.propertyVal(data.screens[0], "id", "AW_PIN_FIREFOX");
assert.propertyVal(data.screens[1], "id", "AW_SET_DEFAULT");
assert.lengthOf(data.screens, getData().screens.length - 3);
assert.lengthOf(data.screens, getData().screens.length - 4);
});
it("should keep 'pin' and remove 'default' if already default", async () => {
const data = await prepConfig({ needPin: true }, [
"AW_EASY_SETUP",
"AW_EASY_SETUP_EMBEDDED",
"AW_WELCOME_BACK",
]);
assert.propertyVal(data.screens[0], "id", "AW_PIN_FIREFOX");
assert.propertyVal(data.screens[1], "id", "AW_IMPORT_SETTINGS");
assert.lengthOf(data.screens, getData().screens.length - 4);
assert.lengthOf(data.screens, getData().screens.length - 5);
});
it("should switch to 'default' if already pinned", async () => {
const data = await prepConfig({ needDefault: true }, [
"AW_EASY_SETUP",
"AW_EASY_SETUP_EMBEDDED",
"AW_WELCOME_BACK",
]);
assert.propertyVal(data.screens[0], "id", "AW_ONLY_DEFAULT");
assert.propertyVal(data.screens[1], "id", "AW_IMPORT_SETTINGS");
assert.lengthOf(data.screens, getData().screens.length - 4);
assert.lengthOf(data.screens, getData().screens.length - 5);
});
it("should switch to 'start' if already pinned and default", async () => {
const data = await prepConfig({}, ["AW_EASY_SETUP", "AW_WELCOME_BACK"]);
const data = await prepConfig({}, [
"AW_EASY_SETUP",
"AW_EASY_SETUP_EMBEDDED",
"AW_WELCOME_BACK",
]);
assert.propertyVal(data.screens[0], "id", "AW_GET_STARTED");
assert.propertyVal(data.screens[1], "id", "AW_IMPORT_SETTINGS");
assert.lengthOf(data.screens, getData().screens.length - 4);
assert.lengthOf(data.screens, getData().screens.length - 5);
});
it("should have a FxA button", async () => {
const data = await prepConfig({}, ["AW_WELCOME_BACK"]);