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

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

Issue 2262993002: Fixes deleting history when there is only one item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes removing of single child top level history items. 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
« no previous file with comments | « chrome/browser/resources/md_history/history_list_behavior.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_list_test.js
diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js
index 8d6a43405bb28229e8a88d1aeb80d4f76fef67df..30ff60574072219c882d2e458ecccda897715086 100644
--- a/chrome/test/data/webui/md_history/history_list_test.js
+++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -35,6 +35,38 @@ cr.define('md_history.history_list_test', function() {
app.queryState_.incremental = true;
});
+ test('deleting single item', function(done) {
+ var listContainer = app.$.history;
+ app.historyResult(createHistoryInfo(), [
+ createHistoryEntry('2015-01-01', 'http://example.com')
+ ]);
+
+ flush().then(function() {
+ assertEquals(element.historyData_.length, 1);
+ items = polymerSelectAll(element, 'history-item');
+ MockInteractions.tap(items[0].$.checkbox);
+ assertDeepEquals([true],
+ element.historyData_.map(i => i.selected));
+ return flush();
+ }).then(function() {
+ MockInteractions.tap(app.$.toolbar.$$('#delete-button'));
+ return listContainer.$.dialog.get();
+ }).then(function(dialog) {
+ registerMessageCallback('removeVisits', this, function() {
+ flush().then(function() {
+ deleteComplete();
+ return flush();
+ }).then(function() {
+ items = polymerSelectAll(element, 'history-item');
+ assertEquals(element.historyData_.length, 0);
+ done();
+ });
+ });
+ assertTrue(dialog.open);
+ MockInteractions.tap(listContainer.$$('.action-button'));
+ });
+ });
+
test('cancelling selection of multiple items', function() {
app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
return flush().then(function() {
« no previous file with comments | « chrome/browser/resources/md_history/history_list_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698