Chromium Code Reviews| Index: LayoutTests/fast/events/menu-key-context-menu-position.html |
| diff --git a/LayoutTests/fast/events/menu-key-context-menu-position.html b/LayoutTests/fast/events/menu-key-context-menu-position.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8dafac3e00e847bc41f7b3369fc65f3af8e73c16 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/menu-key-context-menu-position.html |
| @@ -0,0 +1,34 @@ |
| +<!DOCTYPE HTML> |
| +<script src="../../resources/js-test.js"></script> |
| +<script src="../dom/resources/event-sender-util.js"></script> |
| +<script> |
| + var inputNode; |
| + var X,Y, clientX, clientY; |
| + description('Verifies that when element is focused in frames then selection'+ |
| + ' by menu key, context menu should come on focused element. Succeeds if '+ |
| + 'context menu is coming on the focused element and event co-ordinates are'+ |
| + ' at center of the elements bounding box.'); |
| + function onEventInFrame(event) { |
| + shouldBe(event.target.id, 'inputNode'); |
|
Rick Byers
2015/01/07 16:57:34
this should be a string as well. Remember the arg
Deepak
2015/01/08 10:11:28
Done.
Deepak
2015/01/08 10:11:29
Done.
|
| + clientX = event.clientX; |
| + clientY = event.clientY; |
| + shouldBe("clientX","X"); |
| + shouldBe("clientY","Y"); |
| + } |
| + function runTest() { |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + if (!window.eventSender) |
| + return; |
| + inputNode = frames[1].document.getElementById("inputNode"); |
| + var r = inputNode.getBoundingClientRect(); |
| + X = (r.left + r.right) / 2 |
| + Y = (r.top + r.bottom) / 2; |
| + inputNode.focus(); |
| + eventSender.keyDown("menu"); |
| + } |
| +</script> |
| +<body> |
|
Rick Byers
2015/01/07 16:57:34
nit: no need for a body tag: http://www.chromium.o
Deepak
2015/01/08 10:11:29
Done.
|
| + <iframe src="resources/window-opened.html"></iframe> |
|
Rick Byers
2015/01/07 16:57:34
what is this other iframe for? You can probably r
Deepak
2015/01/08 10:11:28
Done.
|
| + <iframe id="myframe" style="margin-top:50px" onload="runTest()" src="resources/menu-key-context-menu-position-frame.html"><iframe> |
| +</body> |