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

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
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..353d81d37126a1c7bb420e1ede27b70723841090 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,75 @@ cr.define('md_history.history_synced_tabs_test', function() {
});
});
+ test('show sign in promo', function() {
+ updateSignInState(false);
+ return flush()
+ .then(function() {
tsergeant 2016/06/21 04:33:51 Put flush and then on the same line, then indent b
lshang 2016/06/21 05:40:00 Done.
+ 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);
+ assertEquals(
+ '\n Loading...\n ',
tsergeant 2016/06/21 04:33:51 Checking the string like this is quite means that
lshang 2016/06/21 05:40:00 Done.
+ element.$['no-synced-tabs'].textContent);
+
+ 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);
+ assertEquals(
+ '\n No synced tabs\n ',
+ element.$['no-synced-tabs'].textContent);
+
+ 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 tab' 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 = '';

Powered by Google App Engine
This is Rietveld 408576698