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

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

Issue 2118383003: MD History: add shortcuts for search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test change 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/test/data/webui/md_history/history_overflow_menu_test.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_toolbar_test.js
diff --git a/chrome/test/data/webui/md_history/history_toolbar_test.js b/chrome/test/data/webui/md_history/history_toolbar_test.js
index 86f6f02b4b08ee39cda66844f1a1a2f62825b14a..6eb61f63dd092eba2d632b219bdb81cd9421ce43 100644
--- a/chrome/test/data/webui/md_history/history_toolbar_test.js
+++ b/chrome/test/data/webui/md_history/history_toolbar_test.js
@@ -52,6 +52,26 @@ cr.define('md_history.history_toolbar_test', function() {
toolbar.$$('cr-toolbar').fire('search-changed', 'Test');
});
+ test('shortcuts to open search field', function() {
+ var field = toolbar.$['main-toolbar'].getSearchField();
+ assertFalse(field.showingSearch);
+
+ MockInteractions.pressAndReleaseKeyOn(
+ document.body, 191, '', '/');
+ assertTrue(field.showingSearch);
+ assertEquals(field.$.searchInput, field.root.activeElement);
+
+ MockInteractions.pressAndReleaseKeyOn(
+ field.$.searchInput, 27, '', 'Escape');
+ assertFalse(field.showingSearch, 'Pressing escape closes field.');
+ assertNotEquals(field.$.searchInput, field.root.activeElement);
+
+ MockInteractions.pressAndReleaseKeyOn(
+ document.body, 70, 'ctrl', 'f');
+ assertTrue(field.showingSearch);
+ assertEquals(field.$.searchInput, field.root.activeElement);
+ });
+
teardown(function() {
element.historyData_ = [];
element.searchedTerm = '';
« no previous file with comments | « chrome/test/data/webui/md_history/history_overflow_menu_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698