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

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

Issue 2159773003: MD History: Add shortcuts for 'Delete' and 'Backspace' to delete selected items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@MDH_slash_key
Patch Set: revise test 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/history.html ('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 0ccad6a453a07b595909a15ac7015bf958680251..1b8d6b5b1fc9c59f83e95db4f8655d0def19e809 100644
--- a/chrome/test/data/webui/md_history/history_list_test.js
+++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -231,6 +231,45 @@ cr.define('md_history.history_list_test', function() {
});
});
+ test('deleting items using shortcuts', function(done) {
+ var listContainer = app.$.history;
+ app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
+ flush().then(function() {
+ items = Polymer.dom(element.root).querySelectorAll('history-item');
+
+ // Dialog should not appear when there is no item selected.
+ MockInteractions.pressAndReleaseKeyOn(
+ document.body, 46, '', 'Delete');
+ assertFalse(listContainer.$.dialog.opened);
+
+ MockInteractions.tap(items[1].$.checkbox);
+ MockInteractions.tap(items[2].$.checkbox);
+
+ assertEquals(2, toolbar.count);
+
+ registerMessageCallback('removeVisits', this, function(toRemove) {
+ assertEquals('https://www.example.com', toRemove[0].url);
+ assertEquals('https://www.google.com', toRemove[1].url);
+ assertEquals('2016-03-14 10:00 UTC', toRemove[0].timestamps[0]);
+ assertEquals('2016-03-14 9:00 UTC', toRemove[1].timestamps[0]);
+ done();
+ });
+
+ MockInteractions.pressAndReleaseKeyOn(
+ document.body, 46, '', 'Delete');
+ assertTrue(listContainer.$.dialog.opened);
+
+ MockInteractions.tap(listContainer.$$('.cancel-button'));
+ assertFalse(listContainer.$.dialog.opened);
+
+ MockInteractions.pressAndReleaseKeyOn(
+ document.body, 8, '', 'Backspace');
+ assertTrue(listContainer.$.dialog.opened);
+
+ MockInteractions.tap(listContainer.$$('.action-button'));
+ });
+ });
+
teardown(function() {
element.historyData_ = [];
element.searchedTerm = '';
« no previous file with comments | « chrome/browser/resources/md_history/history.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698