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..0d502795ad2505a88d8b82ac8b635aba5f412685 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( |
+ field.$.searchInput, 191, '', '/'); |
tsergeant
2016/07/08 00:26:05
In MockInteractions.pressAndReleaseKeyOn, it's pro
lshang
2016/07/08 05:37:24
Done.
|
+ 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( |
tsergeant
2016/07/08 00:26:05
As above, use document here.
lshang
2016/07/08 05:37:24
Done.
|
+ field.$.searchInput, 70, 'ctrl', 'f'); |
+ assertTrue(field.showingSearch); |
+ assertEquals(field.$.searchInput, field.root.activeElement); |
+ }); |
+ |
teardown(function() { |
element.historyData_ = []; |
element.searchedTerm = ''; |