Commit b7ca54ae authored by David Roger's avatar David Roger Committed by Commit Bot

[settings] Remove unnecessary diceEnabled checks in people_page.html

Dice is now always enabled, these checks are unnecessary around
#edit-profile.

The sync-overview section can be completely removed, because it is only
shown when dice is disabled and signin is allowed, which is no longer a
possible state since dice was enabled by default.

The test suite DiceUITest can now be removed and merged with the general
test suite.

Bug: 891781
Change-Id: Ida75b66481d8a29ed983864aa5da24f0e1d835a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019447Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735787}
parent a1e11afb
......@@ -156,23 +156,6 @@
</div>
</template> <!-- if="[[!shouldShowSyncAccountControl_()]]" -->
<!-- Chrome OS uses settings-sync-account-control for sync promos. -->
<if expr="not chromeos">
<template is="dom-if" if="[[!syncStatus.signedIn]]">
<template is="dom-if" if="[[!diceEnabled_]]">
<div class="settings-box two-line" id="sync-overview"
hidden="[[!syncStatus.signinAllowed]]">
<div class="start settings-box-text">
$i18n{syncOverview}
<a target="_blank" href="$i18n{syncLearnMoreUrl}">
$i18n{learnMore}
</a>
</div>
</div>
</template> <!-- if="[[!diceEnabled_]]" -->
</template>
</if>
<cr-link-row id="sync-setup"
label="$i18n{syncAndNonPersonalizedServices}"
sub-label="[[getSyncAndGoogleServicesSubtext_(syncStatus)]]"
......@@ -181,22 +164,20 @@
</cr-link-row>
<if expr="not chromeos">
<template is="dom-if" if="[[diceEnabled_]]">
<cr-link-row id="manage-google-account"
label="$i18n{manageGoogleAccount}"
hidden="[[!shouldShowGoogleAccount_]]"
on-click="openGoogleAccount_" external></cr-link-row>
<div class="settings-box" id="edit-profile" on-click="onProfileTap_"
actionable>
<div class="start settings-box-text">
$i18n{profileNameAndPicture}
</div>
<cr-icon-button class="subpage-arrow" aria-label="$i18n{editPerson}"
aria-roledescription="$i18n{subpageArrowRoleDescription}">
</cr-icon-button>
<cr-link-row id="manage-google-account"
label="$i18n{manageGoogleAccount}"
hidden="[[!shouldShowGoogleAccount_]]"
on-click="openGoogleAccount_" external></cr-link-row>
<div class="settings-box" id="edit-profile" on-click="onProfileTap_"
actionable>
<div class="start settings-box-text">
$i18n{profileNameAndPicture}
</div>
</template>
<cr-icon-button class="subpage-arrow" aria-label="$i18n{editPerson}"
aria-roledescription="$i18n{subpageArrowRoleDescription}">
</cr-icon-button>
</div>
</if>
<if expr="not chromeos">
......
......@@ -105,57 +105,17 @@ cr.define('settings_people_page', function() {
assertTrue(peoplePage.$.toast.open);
});
// This makes sure UI meant for DICE-enabled profiles are not leaked to
// non-dice profiles.
// TODO(tangltom): This should be removed once all profiles are fully
// migrated.
test('NoManageProfileRow', function() {
assertFalse(!!peoplePage.$$('#edit-profile'));
});
});
suite('DiceUITest', function() {
suiteSetup(function() {
// Force UIs to think DICE is enabled for this profile.
loadTimeData.overrideValues({
diceEnabled: true,
});
});
setup(function() {
syncBrowserProxy = new TestSyncBrowserProxy();
settings.SyncBrowserProxyImpl.instance_ = syncBrowserProxy;
profileInfoBrowserProxy = new TestProfileInfoBrowserProxy();
settings.ProfileInfoBrowserProxyImpl.instance_ =
profileInfoBrowserProxy;
PolymerTest.clearBody();
peoplePage = document.createElement('settings-people-page');
peoplePage.pageVisibility = settings.pageVisibility;
document.body.appendChild(peoplePage);
Polymer.dom.flush();
});
teardown(function() {
peoplePage.remove();
});
test('ShowCorrectRows', function() {
return syncBrowserProxy.whenCalled('getSyncStatus').then(function() {
// The correct /manageProfile link row is shown.
assertTrue(!!peoplePage.$$('#edit-profile'));
assertFalse(!!peoplePage.$$('#picture-subpage-trigger'));
// Sync-overview row should not exist when diceEnabled is true, even
// if syncStatus values would've warranted the row otherwise.
sync_test_util.simulateSyncStatus({
signedIn: false,
signinAllowed: true,
syncSystemEnabled: true,
});
assertFalse(!!peoplePage.$$('#sync-overview'));
// The control element should exist when policy allows.
const accountControl = peoplePage.$$('settings-sync-account-control');
......
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