Commit 17971905 authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Update sync consent screen again for SplitSettingsSync

Based on UI review comments this one has:
* Title "You're signed in"
* Subtitle "The following services help..."
* Buttons "No thanks" and "Got it"

See bug for screenshot.

Bug: 1074436
Test: updated browser_tests
Change-Id: Ifa214522511fadaed7bdf166b2a865632422de7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247327Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779540}
parent 3b888615
c29ba6a3c080832cae7f49c687ef3869f7cab98b
\ No newline at end of file
b4dba45a8eb4438b48f9bbce39f4e4b62be3035f
\ No newline at end of file
c29ba6a3c080832cae7f49c687ef3869f7cab98b
\ No newline at end of file
b4dba45a8eb4438b48f9bbce39f4e4b62be3035f
\ No newline at end of file
c29ba6a3c080832cae7f49c687ef3869f7cab98b
\ No newline at end of file
b4dba45a8eb4438b48f9bbce39f4e4b62be3035f
\ No newline at end of file
b4dba45a8eb4438b48f9bbce39f4e4b62be3035f
\ No newline at end of file
......@@ -128,14 +128,16 @@ class SyncConsentTest : public OobeBaseTest {
OobeBaseTest::SetUpOnMainThread();
if (features::IsSplitSettingsSyncEnabled()) {
expected_consent_ids_ = {
IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE,
IDS_LOGIN_SYNC_CONSENT_SCREEN_SUBTITLE,
IDS_LOGIN_SYNC_CONSENT_SCREEN_OS_SYNC_NAME,
IDS_LOGIN_SYNC_CONSENT_SCREEN_OS_SYNC_DESCRIPTION,
IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_BROWSER_SYNC_NAME,
IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_SYNC_DESCRIPTION,
IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_NAME,
IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_DESCRIPTION,
IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE,
IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT,
IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE2,
IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT2,
};
} else {
expected_consent_ids_ = {
......@@ -439,23 +441,23 @@ IN_PROC_BROWSER_TEST_F(SyncConsentSplitSettingsSyncTest, MAYBE_DefaultFlow) {
// Consent was recorded for the confirmation button.
EXPECT_EQ(SyncConsentScreen::CONSENT_GIVEN,
consent_recorded_waiter.consent_given_);
EXPECT_EQ("Yes, I'm in",
consent_recorded_waiter.consent_confirmation_string_);
EXPECT_EQ(IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT,
EXPECT_EQ("Got it", consent_recorded_waiter.consent_confirmation_string_);
EXPECT_EQ(IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT2,
consent_recorded_waiter.consent_confirmation_id_);
// Consent was recorded for all descriptions, including the confirmation
// button label.
std::vector<int> expected_ids = {
IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE_WITH_DEVICE,
IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE,
IDS_LOGIN_SYNC_CONSENT_SCREEN_SUBTITLE,
IDS_LOGIN_SYNC_CONSENT_SCREEN_OS_SYNC_NAME,
IDS_LOGIN_SYNC_CONSENT_SCREEN_OS_SYNC_DESCRIPTION,
IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_BROWSER_SYNC_NAME,
IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_SYNC_DESCRIPTION,
IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_NAME,
IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_DESCRIPTION,
IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT,
IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE,
IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT2,
IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE2,
};
EXPECT_THAT(consent_recorded_waiter.consent_description_ids_,
testing::UnorderedElementsAreArray(expected_ids));
......@@ -554,7 +556,7 @@ IN_PROC_BROWSER_TEST_F(SyncConsentSplitSettingsSyncTest, LanguageSwitch) {
UnorderedElementsAreArray(GetLocalizedExpectedConsentStrings()));
EXPECT_THAT(
consent_recorded_waiter.consent_confirmation_string_,
Eq(GetLocalizedConsentString(IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT)));
Eq(GetLocalizedConsentString(IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT2)));
}
IN_PROC_BROWSER_TEST_F(SyncConsentSplitSettingsSyncTest, LanguageVariant) {
......@@ -574,7 +576,7 @@ IN_PROC_BROWSER_TEST_F(SyncConsentSplitSettingsSyncTest, LanguageVariant) {
UnorderedElementsAreArray(GetLocalizedExpectedConsentStrings()));
EXPECT_THAT(
consent_recorded_waiter.consent_confirmation_string_,
Eq(GetLocalizedConsentString(IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT)));
Eq(GetLocalizedConsentString(IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT2)));
}
IN_PROC_BROWSER_TEST_F(SyncConsentSplitSettingsSyncTest,
......
......@@ -74,11 +74,12 @@
aria-label$="[[i18nDynamic(locale, 'syncConsentScreenTitle')]]" hidden>
<hd-iron-icon slot="oobe-icon" icon1x="sync-consent-32:googleg" icon2x="sync-consent-64:googleg">
</hd-iron-icon>
<!-- The string contains a substitution, so consent is recorded directly
by SyncConsentScreenHandler instead of using consent-description. -->
<h1 slot="title">
[[i18nDynamic(locale, 'syncConsentScreenTitleWithDevice', deviceType_)]]
<h1 slot="title" consent-description>
[[i18nDynamic(locale, 'syncConsentScreenTitle')]]
</h1>
<div slot="subtitle" consent-description>
[[i18nDynamic(locale, 'syncConsentScreenSubtitle')]]
</div>
<div slot="footer" class="layout vertical flex">
<!-- "Chrome OS settings sync" -->
......
......@@ -29,6 +29,8 @@ Polymer({
/**
* The device type (e.g. "Chromebook" or "Chromebox").
* TODO(jamescook): Delete this after M85 once we're sure UX doesn't want
* the device type in the dialog.
* @private
*/
deviceType_: String,
......
......@@ -112,9 +112,8 @@ void SyncConsentScreenHandler::DeclareLocalizedValues(
builder);
// SplitSettingsSync strings.
RememberLocalizedValue("syncConsentScreenTitleWithDevice",
IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE_WITH_DEVICE,
builder);
RememberLocalizedValue("syncConsentScreenSubtitle",
IDS_LOGIN_SYNC_CONSENT_SCREEN_SUBTITLE, builder);
RememberLocalizedValue("syncConsentScreenOsSyncName",
IDS_LOGIN_SYNC_CONSENT_SCREEN_OS_SYNC_NAME, builder);
RememberLocalizedValue("syncConsentScreenOsSyncDescription",
......@@ -124,9 +123,9 @@ void SyncConsentScreenHandler::DeclareLocalizedValues(
IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_BROWSER_SYNC_NAME,
builder);
RememberLocalizedValue("syncConsentScreenAccept",
IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT, builder);
IDS_LOGIN_SYNC_CONSENT_SCREEN_ACCEPT2, builder);
RememberLocalizedValue("syncConsentScreenDecline",
IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE, builder);
IDS_LOGIN_SYNC_CONSENT_SCREEN_DECLINE2, builder);
}
void SyncConsentScreenHandler::Bind(SyncConsentScreen* screen) {
......@@ -227,10 +226,6 @@ void SyncConsentScreenHandler::Continue(
int consent_confirmation_id;
GetConsentIDs(known_string_ids_, consent_description, consent_confirmation,
&consent_description_ids, &consent_confirmation_id);
// Manually add this ID because the string contains a runtime substitution,
// so it's not included in GetConsentIDs().
consent_description_ids.push_back(
IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE_WITH_DEVICE);
screen_->OnContinue(consent_description_ids, consent_confirmation_id, choice);
SyncConsentScreen::SyncConsentScreenTestDelegate* test_delegate =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment