Chromium Code Reviews| 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 50ecea196f3d3c62153155e39bdeeb7def48a5d6..20ec82fa18b37c4277adb81b94e5c875e0d84abb 100644 |
| --- a/chrome/test/data/webui/md_history/history_toolbar_test.js |
| +++ b/chrome/test/data/webui/md_history/history_toolbar_test.js |
| @@ -8,7 +8,7 @@ cr.define('md_history.history_toolbar_test', function() { |
| var app; |
| var element; |
| var toolbar; |
| - var TEST_HISTORY_RESULTS; |
| + var TEST_HISTORY_RESULTS |
|
tsergeant
2016/08/19 00:21:38
Nit: you left the semicolon....
|
| suiteSetup(function() { |
| app = $('history-app'); |
| @@ -54,6 +54,7 @@ cr.define('md_history.history_toolbar_test', function() { |
| test('shortcuts to open search field', function() { |
| var field = toolbar.$['main-toolbar'].getSearchField(); |
| + field.blur(); |
| assertFalse(field.showingSearch); |
| MockInteractions.pressAndReleaseKeyOn( |
| @@ -100,3 +101,57 @@ cr.define('md_history.history_toolbar_test', function() { |
| registerTests: registerTests |
| }; |
| }); |
| + |
| + |
| +cr.define('md_history.history_toolbar_focus_test', function() { |
| + function registerTests() { |
| + suite('history-toolbar', function() { |
| + var app; |
| + var element; |
| + var toolbar; |
| + var TEST_HISTORY_RESULTS = |
| + [createHistoryEntry('2016-03-15', 'https://google.com')]; |
| + ; |
|
tsergeant
2016/08/19 00:21:38
...down here
calamity
2016/08/19 03:50:57
Man, it's always in the last place you look.
|
| + |
| + setup(function() { |
| + PolymerTest.clearBody(); |
|
tsergeant
2016/08/19 00:21:38
Nit: If you rebase past https://codereview.chromiu
calamity
2016/08/19 03:50:57
Done.
|
| + app = document.createElement('history-app'); |
| + app.id = 'history-app'; |
| + document.body.appendChild(app); |
| + |
| + element = app.$['history'].$['infinite-list']; |
| + toolbar = app.$['toolbar']; |
| + }); |
| + |
| + test('search bar is focused on load in wide mode', function() { |
| + window.resultsRendered = false; |
| + app.hasDrawer_ = false; |
| + |
| + historyResult(createHistoryInfo(), []); |
| + return flush().then(() => { |
| + // Ensure the search bar is focused on load. |
| + assertTrue( |
| + app.$.toolbar.$['main-toolbar'] |
| + .getSearchField() |
| + .isSearchFocused()); |
| + }); |
| + }); |
| + |
| + test('search bar is not focused on load in narrow mode', function() { |
| + app.hasDrawer_ = true; |
| + |
| + historyResult(createHistoryInfo(), []); |
| + // Ensure the search bar is focused on load. |
| + assertFalse( |
| + $('history-app') |
| + .$.toolbar.$['main-toolbar'] |
| + .getSearchField() |
| + .isSearchFocused()); |
| + }); |
| + }); |
| + }; |
| + |
| + return { |
| + registerTests: registerTests |
| + }; |
| +}); |