| 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>
|
|
|