OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <script src="../dom/resources/event-sender-util.js"></script> | 4 <script src="../dom/resources/event-sender-util.js"></script> |
5 <style> | 5 <style> |
6 #anchor { | 6 #anchor { |
7 background-color: orange; | 7 background-color: orange; |
8 height: 100px; | 8 height: 100px; |
9 margin: 10px; | 9 margin: 10px; |
10 width: 100px; | 10 width: 100px; |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 document.addEventListener('contextmenu', handleContextMenu, true); | 26 document.addEventListener('contextmenu', handleContextMenu, true); |
27 | 27 |
28 if (!window.eventSender || !window.testRunner) { | 28 if (!window.eventSender || !window.testRunner) { |
29 testFailed('This test needs to run in a test environment.'); | 29 testFailed('This test needs to run in a test environment.'); |
30 } else { | 30 } else { |
31 var anchor = document.getElementById("anchor"); | 31 var anchor = document.getElementById("anchor"); |
32 mouseMoveToElem(anchor); | 32 mouseMoveToElem(anchor); |
33 eventSender.contextClick(); | 33 eventSender.contextClick(); |
34 // Esc key to hide context menu | 34 // Esc key to hide context menu |
35 eventSender.keyDown(String.fromCharCode(0x001B)); | 35 eventSender.keyDown("escape"); |
36 anchor.focus(); | 36 anchor.focus(); |
37 eventSender.keyDown("menu"); | 37 eventSender.keyDown("menu"); |
38 } | 38 } |
39 </script> | 39 </script> |
40 </body> | 40 </body> |
OLD | NEW |