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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/context-menu-key-shift-f10-modifiers.html

Issue 2122053003: Shift+F10 should open Context Menu regardless the state of NumLock/CapsLock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Test Context Menu Key, Shift+F10 with Modifiers</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <a href="#" id="anchor">Anchor</a>
6 <script>
7 test(function() {
8 assert_not_equals(window.eventSender, undefined, 'This test requires eventSe nder.');
9
10 var contextMenuFired = false;
11 var anchor = document.getElementById('anchor');
12 anchor.addEventListener('contextmenu', () => contextMenuFired = true);
13
14 function testContextMenuEvent(key, modifiers, shouldFire) {
15 contextMenuFired = false;
16 anchor.focus();
17 eventSender.keyDown(key, modifiers);
18 // Esc key to hide context menu
19 eventSender.keyDown("Escape");
20 assert_equals(contextMenuFired, shouldFire, `${key}+${modifiers} opens C ontext Menu:${shouldFire}.`);
21 }
22
23 testContextMenuEvent('ContextMenu', [], true);
24 testContextMenuEvent('ContextMenu', ['numLockOn'], true);
25 testContextMenuEvent('ContextMenu', ['capsLockOn'], true);
26 testContextMenuEvent('ContextMenu', ['altKey'], false);
27 testContextMenuEvent('ContextMenu', ['ctrlKey'], false);
28 testContextMenuEvent('ContextMenu', ['shiftKey'], false);
29
30 testContextMenuEvent('F10', ['shiftKey'], true);
31 testContextMenuEvent('F10', ['shiftKey', 'numLockOn'], true);
32 testContextMenuEvent('F10', ['shiftKey', 'capsLockOn'], true);
33 testContextMenuEvent('F10', ['shiftKey', 'altKey'], false);
34 testContextMenuEvent('F10', ['shiftKey', 'ctrlKey'], false);
35 }, 'Context Menu keys should allow NumLock/CapsLock/etc but not other modifiers. ');
36 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/NeverFixTests ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698