Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8902)

Unified Diff: chrome/test/data/webui/md_history/history_synced_tabs_test.js

Issue 2077473002: MD History: add sign in promo in synced tabs when user isn't logged in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_history/history_synced_tabs_test.js
diff --git a/chrome/test/data/webui/md_history/history_synced_tabs_test.js b/chrome/test/data/webui/md_history/history_synced_tabs_test.js
index dfce76a312755819d2d823a102ffdbe20e3339f2..7c39f86c677c1f229ac46ec4cf9a9d3b600d2b12 100644
--- a/chrome/test/data/webui/md_history/history_synced_tabs_test.js
+++ b/chrome/test/data/webui/md_history/history_synced_tabs_test.js
@@ -173,6 +173,73 @@ cr.define('md_history.history_synced_tabs_test', function() {
});
});
+ test('show sign in promo', function() {
+ updateSignInState(false);
+ return flush().then(function() {
+ assertFalse(element.$['sign-in-guide'].hidden);
+ updateSignInState(true);
+ return flush();
+ }).then(function() {
+ assertTrue(element.$['sign-in-guide'].hidden);
+ });
+ });
+
+ test('no synced tabs message', function() {
+ // When user is not logged in, there is no synced tabs.
+ element.signInState_ = false;
+ element.syncedDevices_ = [];
+ return flush().then(function() {
+ assertTrue(element.$['no-synced-tabs'].hidden);
+
+ var cards = getCards();
+ assertEquals(0, cards.length);
+
+ updateSignInState(true);
+
+ return flush();
+ }).then(function() {
+ // When user signs in, first show loading message.
+ assertFalse(element.$['no-synced-tabs'].hidden);
+ var loading = loadTimeData.getString('loading');
+ assertNotEquals(
+ -1, element.$['no-synced-tabs'].textContent.indexOf(loading));
+
+ var sessionList = [];
+ setForeignSessions(sessionList, true);
+ return flush();
+ }).then(function() {
+ cards = getCards();
+ assertEquals(0, cards.length);
+ // If no synced tabs are fetched, show 'no synced tabs'.
+ assertFalse(element.$['no-synced-tabs'].hidden);
+ var noSyncedResults = loadTimeData.getString('noSyncedResults');
+ assertNotEquals(
+ -1,
+ element.$['no-synced-tabs'].textContent.indexOf(noSyncedResults));
+
+ var sessionList = [
+ createSession(
+ 'Nexus 5',
+ [createWindow(['http://www.google.com', 'http://example.com'])]
+ )
+ ];
+ setForeignSessions(sessionList, true);
+
+ return flush();
+ }).then(function() {
+ cards = getCards();
+ assertEquals(1, cards.length);
+ // If there are any synced tabs, hide the 'no synced tabs' message.
+ assertTrue(element.$['no-synced-tabs'].hidden);
+
+ updateSignInState(false);
+ return flush();
+ }).then(function() {
+ // When user signs out, don't show the message.
+ assertTrue(element.$['no-synced-tabs'].hidden);
+ });
+ });
+
teardown(function() {
element.syncedDevices = [];
element.searchedTerm = '';
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698