Commit 2716ccff authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

Settings: Fix logic for showing entry points to manageProfile/

There are two such entry points and only one should be shown at a
given time, based on whether signinAllowed is true/false. Incorrectly,
both of them were showing when signinAllowed=false.

Existing tests were failing to catch the problem, and erroneously
succeeded. Fixing tests as well.

Fixed: 1063451
Change-Id: Ic0b6046b2f6e5934a76133ca95a702f9bc79bd46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2112899
Commit-Queue: dpapad <dpapad@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752563}
parent 72625ffc
...@@ -155,20 +155,22 @@ ...@@ -155,20 +155,22 @@
</cr-link-row> </cr-link-row>
<if expr="not chromeos"> <if expr="not chromeos">
<cr-link-row id="manage-google-account" <template is="dom-if" if="[[signinAllowed_]]">
label="$i18n{manageGoogleAccount}" <cr-link-row id="manage-google-account"
hidden="[[!shouldShowGoogleAccount_]]" label="$i18n{manageGoogleAccount}"
on-click="openGoogleAccount_" external></cr-link-row> hidden="[[!shouldShowGoogleAccount_]]"
on-click="openGoogleAccount_" external></cr-link-row>
<div class="settings-box" id="edit-profile" on-click="onProfileTap_"
actionable> <div class="settings-box" id="edit-profile" on-click="onProfileTap_"
<div class="start settings-box-text"> actionable>
$i18n{profileNameAndPicture} <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>
</div> </div>
<cr-icon-button class="subpage-arrow" aria-label="$i18n{editPerson}" </template>
aria-roledescription="$i18n{subpageArrowRoleDescription}">
</cr-icon-button>
</div>
</if> </if>
<if expr="not chromeos"> <if expr="not chromeos">
......
...@@ -97,12 +97,13 @@ cr.define('settings_people_page', function() { ...@@ -97,12 +97,13 @@ cr.define('settings_people_page', function() {
peoplePage.remove(); peoplePage.remove();
}); });
// TODO(crbug.com/1063451): Re-enable once fixed. test('ShowCorrectRows', function() {
test.skip('ShowCorrectRows', function(done) {
return syncBrowserProxy.whenCalled('getSyncStatus').then(function() { return syncBrowserProxy.whenCalled('getSyncStatus').then(function() {
Polymer.dom.flush();
// The correct /manageProfile link row is shown. // The correct /manageProfile link row is shown.
assertTrue(!!peoplePage.$$('#edit-profile')); assertFalse(!!peoplePage.$$('#edit-profile'));
assertFalse(!!peoplePage.$$('#picture-subpage-trigger')); assertTrue(!!peoplePage.$$('#picture-subpage-trigger'));
// Control element doesn't exist when policy forbids sync. // Control element doesn't exist when policy forbids sync.
sync_test_util.simulateSyncStatus({ sync_test_util.simulateSyncStatus({
...@@ -141,9 +142,13 @@ cr.define('settings_people_page', function() { ...@@ -141,9 +142,13 @@ cr.define('settings_people_page', function() {
assertTrue(peoplePage.$.toast.open); assertTrue(peoplePage.$.toast.open);
}); });
// TODO(crbug.com/1063451): Re-enable once fixed. test('ShowCorrectRows', function() {
test.skip('ShowCorrectRows', function() {
return syncBrowserProxy.whenCalled('getSyncStatus').then(function() { return syncBrowserProxy.whenCalled('getSyncStatus').then(function() {
sync_test_util.simulateSyncStatus({
syncSystemEnabled: true,
});
Polymer.dom.flush();
// The correct /manageProfile link row is shown. // The correct /manageProfile link row is shown.
assertTrue(!!peoplePage.$$('#edit-profile')); assertTrue(!!peoplePage.$$('#edit-profile'));
assertFalse(!!peoplePage.$$('#picture-subpage-trigger')); assertFalse(!!peoplePage.$$('#picture-subpage-trigger'));
......
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