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

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

Issue 2195593002: MD History: Fix clicking on synced tab links (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix closure Created 4 years, 5 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/resources/md_history/synced_device_card.js ('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 c62458034a9138b8935eca8954f696e744a6a9f5..17b0c4ebefaa60e25b7555211793709d80fe556b 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
@@ -17,11 +17,12 @@ cr.define('md_history.history_synced_tabs_test', function() {
function createWindow(tabUrls) {
var tabs = tabUrls.map(function(tabUrl) {
- return {sessionId: 0, timestamp: 0, title: tabUrl, url: tabUrl};
+ return {sessionId: 456, timestamp: 0, title: tabUrl, url: tabUrl};
});
return {
tabs: tabs,
+ sessionId: '123',
userVisibleTimestamp: "A while ago"
};
}
@@ -186,6 +187,26 @@ cr.define('md_history.history_synced_tabs_test', function() {
});
});
+ test('click synced tab', function(done) {
+ setForeignSessions(
+ [createSession(
+ 'Chromebook', [createWindow(['https://example.com'])])],
+ true);
+
+ registerMessageCallback('openForeignSession', this, function(args) {
+ assertEquals('Chromebook', args[0], 'sessionTag is correct');
+ assertEquals('123', args[1], 'windowId is correct');
+ assertEquals('456', args[2], 'tabId is correct');
+ done();
+ });
+
+ flush().then(function() {
+ var cards = getCards();
+ var anchor = cards[0].root.querySelector('a');
+ MockInteractions.tap(anchor);
+ });
+ });
+
test('show sign in promo', function() {
updateSignInState(false);
return flush().then(function() {
@@ -264,6 +285,7 @@ cr.define('md_history.history_synced_tabs_test', function() {
element.syncedDevices = [];
element.searchTerm = '';
element.guestSession_ = false;
+ registerMessageCallback('openForeignSession', this, undefined);
});
});
}
« no previous file with comments | « chrome/browser/resources/md_history/synced_device_card.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698