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

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

Issue 1874473004: MD History: Support dynamically updating synced tab data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 00317ddb037a9bafa2d30467b9e6e8e0b33afec3..dc2f6d182c365d3419a50fbf40cd35f1ebea970e 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
@@ -8,8 +8,9 @@ cr.define('md_history.history_synced_tabs_test', function() {
collapsed: false,
deviceType: '',
name: name,
- modifiedTime: 0,
- tag: '',
+ modifiedTime: '2 seconds ago',
+ tag: name,
+ timestamp: 0,
windows: windows
};
}
@@ -92,6 +93,50 @@ cr.define('md_history.history_synced_tabs_test', function() {
});
});
+ test('updating sessions', function(done) {
+ var session1 = createSession(
+ 'Chromebook',
+ [createWindow(['http://www.example.com', 'http://crbug.com'])]);
+ session1.timestamp = 1000;
+
+ var session2 =
+ createSession('Nexus 5', [createWindow(['http://www.google.com'])]);
+
+ setForeignSessions([session1, session2], true);
+
+ flush(function() {
+ var session1updated = createSession('Chromebook', [
+ createWindow(['http://www.example.com', 'http://crbug.com/new']),
+ createWindow(['http://web.site'])
+ ]);
+ session1updated.timestamp = 1234;
+
+ setForeignSessions([session1updated, session2], true);
+
+ flush(function() {
+ // There should only be two cards.
+ var cards = Polymer.dom(element.root)
+ .querySelectorAll('history-synced-device-card');
+ assertEquals(2, cards.length);
+
+ // There are now 2 windows in the first device.
+ assertEquals(
+ 2, Polymer.dom(cards[0].root)
+ .querySelectorAll('#window-separator')
+ .length);
+
+ // Check that the actual link changes.
+ assertEquals(
+ 'http://crbug.com/new',
+ Polymer.dom(cards[0].root)
+ .querySelectorAll('.website-title')[1]
+ .textContent.trim());
+
+ done();
+ });
+ });
+ });
+
teardown(function() {
element.syncedDevices = [];
});

Powered by Google App Engine
This is Rietveld 408576698