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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/NeverFixTests ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/events/context-menu-key-shift-f10-modifiers.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/context-menu-key-shift-f10-modifiers.html b/third_party/WebKit/LayoutTests/fast/events/context-menu-key-shift-f10-modifiers.html
new file mode 100644
index 0000000000000000000000000000000000000000..4d577400c7b7a53527aa348b93b65bc0e959b59e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/context-menu-key-shift-f10-modifiers.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Test Context Menu Key, Shift+F10 with Modifiers</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<a href="#" id="anchor">Anchor</a>
+<script>
+test(function() {
+ assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
+
+ var contextMenuFired = false;
+ var anchor = document.getElementById('anchor');
+ anchor.addEventListener('contextmenu', () => contextMenuFired = true);
+
+ function testContextMenuEvent(key, modifiers, shouldFire) {
+ contextMenuFired = false;
+ anchor.focus();
+ eventSender.keyDown(key, modifiers);
+ // Esc key to hide context menu
+ eventSender.keyDown("Escape");
+ assert_equals(contextMenuFired, shouldFire, `${key}+${modifiers} opens Context Menu:${shouldFire}.`);
+ }
+
+ testContextMenuEvent('ContextMenu', [], true);
+ testContextMenuEvent('ContextMenu', ['numLockOn'], true);
+ testContextMenuEvent('ContextMenu', ['capsLockOn'], true);
+ testContextMenuEvent('ContextMenu', ['altKey'], false);
+ testContextMenuEvent('ContextMenu', ['ctrlKey'], false);
+ testContextMenuEvent('ContextMenu', ['shiftKey'], false);
+
+ testContextMenuEvent('F10', ['shiftKey'], true);
+ testContextMenuEvent('F10', ['shiftKey', 'numLockOn'], true);
+ testContextMenuEvent('F10', ['shiftKey', 'capsLockOn'], true);
+ testContextMenuEvent('F10', ['shiftKey', 'altKey'], false);
+ testContextMenuEvent('F10', ['shiftKey', 'ctrlKey'], false);
+}, 'Context Menu keys should allow NumLock/CapsLock/etc but not other modifiers.');
+</script>
« 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