| 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 = [];
|
| });
|
|
|