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

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

Issue 2251323002: MD History: Synced Tabs fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@history_css_shuffle
Patch Set: Closure Created 4 years, 4 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 1aaa566fe0995204f3a5cb2be6104e11a05e8128..95c9959e72fa3308c5d0cc9abda8581c5473e5db 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
@@ -190,6 +190,60 @@ cr.define('md_history.history_synced_tabs_test', function() {
});
});
+ test('delete a session', function(done) {
+ var sessionList = [
+ createSession('Nexus 5', [createWindow(['http://www.example.com'])]),
+ createSession('Pixel C', [createWindow(['http://www.badssl.com'])]),
+ ];
+
+ setForeignSessions(sessionList);
+
+ return flush().then(function() {
+ var cards = getCards(element);
+ assertEquals(2, cards.length);
+
+ MockInteractions.tap(cards[0].$['menu-button']);
+ return flush();
+ }).then(function() {
+ registerMessageCallback('deleteForeignSession', this, function(args) {
+ assertEquals('Nexus 5', args[0]);
+
+ // Simulate deleting the first device.
+ setForeignSessions([sessionList[1]]);
+
+ flush().then(function() {
+ cards = getCards(element);
+ assertEquals(1, cards.length);
+ assertEquals('http://www.badssl.com', cards[0].tabs[0].title);
+ done();
+ });
+ });
+
+ MockInteractions.tap(element.$$('#menuDeleteButton'));
+ });
+ });
+
+ test('delete a collapsed session', function() {
+ var sessionList = [
+ createSession('Nexus 5', [createWindow(['http://www.example.com'])]),
+ createSession('Pixel C', [createWindow(['http://www.badssl.com'])]),
+ ];
+
+ setForeignSessions(sessionList);
+ return flush().then(function() {
+ var cards = getCards(element);
+ MockInteractions.tap(cards[0].$['card-heading']);
+ assertFalse(cards[0].opened);
+
+ // Simulate deleting the first device.
+ setForeignSessions([sessionList[1]]);
+ return flush();
+ }).then(function() {
+ var cards = getCards(element);
+ assertTrue(cards[0].opened);
+ });
+ });
+
test('click synced tab', function(done) {
setForeignSessions(
[createSession(
@@ -282,6 +336,7 @@ cr.define('md_history.history_synced_tabs_test', function() {
teardown(function() {
registerMessageCallback('openForeignSession', this, undefined);
+ registerMessageCallback('deleteForeignSession', this, undefined);
});
});

Powered by Google App Engine
This is Rietveld 408576698