-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[unified-consent] Add sign-in-again button when sync is paused
When sync is paused, i.e. the user is in an auth error, the syncSetup page now has a button to sign in again to resolve the error. Mocks: https://gallery.googleplex.com/projects/MCHbtQVoQ2HCZWnUS9sdsb0Q/files/MCHtA7U1iMGr664Bt8FBOxWEyjSSOyFCbW0 Bug: 856210 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: Iab413fb69fcabff076f3c48d3b828dea05df6229 Reviewed-on: https://chromium-review.googlesource.com/1138619 Commit-Queue: Thomas Tangl <[email protected]> Reviewed-by: Scott Chen <[email protected]> Cr-Commit-Position: refs/heads/master@{#577144}
- Loading branch information
Thomas Tangl
authored and
Commit Bot
committed
Jul 23, 2018
1 parent
5a1fd35
commit d229bab
Showing
5 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ cr.define('settings_sync_account_control', function() { | |
]); | ||
|
||
const userInfo = testElement.$$('#user-info'); | ||
const syncButton = testElement.$$('#avatar-row .action-button'); | ||
const syncButton = testElement.$$('#sync-button'); | ||
|
||
// Avatar row shows the right account. | ||
assertVisible(testElement.$$('#promo-header'), true); | ||
|
@@ -145,7 +145,7 @@ cr.define('settings_sync_account_control', function() { | |
// "sync to" button is showing the correct name and syncs with the | ||
// correct account when clicked. | ||
assertVisible(syncButton, true); | ||
assertVisible(testElement.$$('#avatar-row .secondary-button'), false); | ||
assertVisible(testElement.$$('#turn-off'), false); | ||
assertTrue(syncButton.textContent.includes('foo')); | ||
assertFalse(syncButton.textContent.includes('bar')); | ||
syncButton.click(); | ||
|
@@ -230,8 +230,9 @@ cr.define('settings_sync_account_control', function() { | |
assertFalse(userInfo.textContent.includes('fooName')); | ||
assertFalse(userInfo.textContent.includes('[email protected]')); | ||
|
||
assertVisible(testElement.$$('#avatar-row .action-button'), false); | ||
assertVisible(testElement.$$('#avatar-row .secondary-button'), true); | ||
assertVisible(testElement.$$('#sync-button'), false); | ||
assertVisible(testElement.$$('#turn-off'), true); | ||
assertVisible(testElement.$$('#sync-paused-button'), false); | ||
|
||
testElement.$$('#avatar-row .secondary-button').click(); | ||
Polymer.dom.flush(); | ||
|
@@ -268,6 +269,8 @@ cr.define('settings_sync_account_control', function() { | |
assertFalse(displayedText.includes('barName')); | ||
assertFalse(displayedText.includes('fooName')); | ||
assertTrue(displayedText.includes('Sync is paused')); | ||
// Not embedded in a subpage, so there is no sync-paused button. | ||
assertVisible(testElement.$$('#sync-paused-button'), false); | ||
|
||
testElement.syncStatus = { | ||
signedIn: true, | ||
|
@@ -287,7 +290,7 @@ cr.define('settings_sync_account_control', function() { | |
}); | ||
|
||
test('embedded in another page', function() { | ||
testElement.alwaysShowPromo = true; | ||
testElement.embeddedInSubpage = true; | ||
forcePromoResetWithCount(100, false); | ||
const banner = testElement.$$('#banner'); | ||
assertVisible(banner, true); | ||
|
@@ -301,6 +304,18 @@ cr.define('settings_sync_account_control', function() { | |
}; | ||
|
||
assertVisible(testElement.$$('#turn-off'), false); | ||
assertVisible(testElement.$$('#sync-paused-button'), false); | ||
|
||
testElement.embeddedInSubpage = true; | ||
testElement.syncStatus = { | ||
signedIn: true, | ||
signedInUsername: '[email protected]', | ||
hasError: true, | ||
statusAction: settings.StatusAction.REAUTHENTICATE, | ||
disabled: false, | ||
}; | ||
assertVisible(testElement.$$('#turn-off'), false); | ||
assertVisible(testElement.$$('#sync-paused-button'), true); | ||
}); | ||
}); | ||
}); |