| Index: chrome/test/data/webui/cr_elements/cr_action_menu_test.js
|
| diff --git a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js
|
| index d36f8e9c47b9e936c56bd78e9109ae95af8b265d..9715fba33f54b0568f705bc7bed33a9e220c61ef 100644
|
| --- a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js
|
| +++ b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js
|
| @@ -40,6 +40,10 @@ suite('CrActionMenu', function() {
|
| MockInteractions.keyDownOn(menu, 'ArrowDown', [], 'ArrowDown');
|
| }
|
|
|
| + function up() {
|
| + MockInteractions.keyDownOn(menu, 'ArrowUp', [], 'ArrowUp');
|
| + }
|
| +
|
| test('hidden or disabled items', function() {
|
| menu.showAt(document.querySelector('#dots'));
|
| down();
|
| @@ -59,10 +63,6 @@ suite('CrActionMenu', function() {
|
| });
|
|
|
| test('focus after down/up arrow', function() {
|
| - function up() {
|
| - MockInteractions.keyDownOn(menu, 'ArrowUp', [], 'ArrowUp');
|
| - }
|
| -
|
| menu.showAt(document.querySelector('#dots'));
|
|
|
| // The menu should be focused when shown, but not on any of the items.
|
| @@ -93,6 +93,14 @@ suite('CrActionMenu', function() {
|
| assertEquals(items[0], menu.root.activeElement);
|
| });
|
|
|
| + test('pressing up arrow when no focus will focus last item', function(){
|
| + menu.showAt(document.querySelector('#dots'));
|
| + assertEquals(menu, document.activeElement);
|
| +
|
| + up();
|
| + assertEquals(items[items.length - 1], menu.root.activeElement);
|
| + });
|
| +
|
| test('close on resize', function() {
|
| menu.showAt(document.querySelector('#dots'));
|
| assertTrue(menu.open);
|
|
|