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 @@
</cr-link-row>
<if expr="not chromeos">
<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}
<template is="dom-if" if="[[signinAllowed_]]">
<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>
</div>
<cr-icon-button class="subpage-arrow" aria-label="$i18n{editPerson}"
aria-roledescription="$i18n{subpageArrowRoleDescription}">
</cr-icon-button>
</div>
</template>
</if>
<if expr="not chromeos">
......
......@@ -97,12 +97,13 @@ cr.define('settings_people_page', function() {
peoplePage.remove();
});
// TODO(crbug.com/1063451): Re-enable once fixed.
test.skip('ShowCorrectRows', function(done) {
test('ShowCorrectRows', function() {
return syncBrowserProxy.whenCalled('getSyncStatus').then(function() {
Polymer.dom.flush();
// The correct /manageProfile link row is shown.
assertTrue(!!peoplePage.$$('#edit-profile'));
assertFalse(!!peoplePage.$$('#picture-subpage-trigger'));
assertFalse(!!peoplePage.$$('#edit-profile'));
assertTrue(!!peoplePage.$$('#picture-subpage-trigger'));
// Control element doesn't exist when policy forbids sync.
sync_test_util.simulateSyncStatus({
......@@ -141,9 +142,13 @@ cr.define('settings_people_page', function() {
assertTrue(peoplePage.$.toast.open);
});
// TODO(crbug.com/1063451): Re-enable once fixed.
test.skip('ShowCorrectRows', function() {
test('ShowCorrectRows', function() {
return syncBrowserProxy.whenCalled('getSyncStatus').then(function() {
sync_test_util.simulateSyncStatus({
syncSystemEnabled: true,
});
Polymer.dom.flush();
// The correct /manageProfile link row is shown.
assertTrue(!!peoplePage.$$('#edit-profile'));
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