| 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 9ff3f3281f473d6e6b545c8ac503079142b8a3b2..2df6533405169c327f85a3a744d09bed6384e31d 100644
|
| --- a/chrome/test/data/webui/md_history/history_list_test.js
|
| +++ b/chrome/test/data/webui/md_history/history_list_test.js
|
| @@ -22,6 +22,7 @@ cr.define('md_history.history_list_test', function() {
|
| createHistoryEntry('2016-03-14 9:00', 'https://www.google.com'),
|
| createHistoryEntry('2016-03-13', 'https://en.wikipedia.org')
|
| ];
|
| + TEST_HISTORY_RESULTS[2].starred = true;
|
|
|
| ADDITIONAL_RESULTS = [
|
| createHistoryEntry('2016-03-13 10:00', 'https://en.wikipedia.org'),
|
| @@ -503,6 +504,52 @@ cr.define('md_history.history_list_test', function() {
|
| });
|
| });
|
|
|
| + test('focus and keyboard nav', function() {
|
| + app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
|
| + return flush().then(function() {
|
| + var items = polymerSelectAll(element, 'history-item');
|
| +
|
| + var focused = items[2].$.checkbox;
|
| + focused.focus();
|
| +
|
| + MockInteractions.pressAndReleaseKeyOn(focused, 39, [], 'ArrowRight');
|
| + focused = items[2].$.title;
|
| + assertEquals(focused, element.lastFocused_);
|
| + assertTrue(items[2].row_.isActive());
|
| + assertFalse(items[3].row_.isActive());
|
| +
|
| + MockInteractions.pressAndReleaseKeyOn(focused, 40, [], 'ArrowDown');
|
| + focused = items[3].$.title;
|
| + assertEquals(focused, element.lastFocused_);
|
| + assertFalse(items[2].row_.isActive());
|
| + assertTrue(items[3].row_.isActive());
|
| +
|
| + MockInteractions.pressAndReleaseKeyOn(focused, 39, [], 'ArrowRight');
|
| + focused = items[3].$['menu-button'];
|
| + assertEquals(focused, element.lastFocused_);
|
| + assertFalse(items[2].row_.isActive());
|
| + assertTrue(items[3].row_.isActive());
|
| +
|
| + MockInteractions.pressAndReleaseKeyOn(focused, 38, [], 'ArrowUp');
|
| + focused = items[2].$['menu-button'];
|
| + assertEquals(focused, element.lastFocused_);
|
| + assertTrue(items[2].row_.isActive());
|
| + assertFalse(items[3].row_.isActive());
|
| +
|
| + MockInteractions.pressAndReleaseKeyOn(focused, 37, [], 'ArrowLeft');
|
| + focused = items[2].$$('#bookmark-star');
|
| + assertEquals(focused, element.lastFocused_);
|
| + assertTrue(items[2].row_.isActive());
|
| + assertFalse(items[3].row_.isActive());
|
| +
|
| + MockInteractions.pressAndReleaseKeyOn(focused, 40, [], 'ArrowDown');
|
| + focused = items[3].$.title;
|
| + assertEquals(focused, element.lastFocused_);
|
| + assertFalse(items[2].row_.isActive());
|
| + assertTrue(items[3].row_.isActive());
|
| + });
|
| + });
|
| +
|
| teardown(function() {
|
| element.historyData_ = [];
|
| registerMessageCallback('removeVisits', this, undefined);
|
|
|