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..13985a7aed44ad11455b449d4387516e26f80f9f |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/menu-key-context-menu-position.html |
| @@ -0,0 +1,41 @@ |
| +<!DOCTYPE HTML> |
| +<html> |
| +<head> |
|
Rick Byers
2014/12/19 15:14:27
Nit: omit html and head tags. See http://www.chro
Deepak
2014/12/20 09:35:33
Done.
|
| +<script> |
| + var count = 0; |
| + var anchorNode; |
| + var x,y; |
| + function onEventInFrame(e) { |
| + count++; |
| + if(count === 2) { |
| + if (e.target == anchorNode && e.clientX === x && e.clientY === y) |
|
Rick Byers
2014/12/19 15:14:27
this is what the 'shouldBe' helpers are for in js-
Deepak
2014/12/20 09:35:33
I have tried to use description() but I am not abl
|
| + alert("PASS"); |
| + else |
| + alert("FAIL"); |
| + } |
| + return false; |
| + } |
| + function runTest() { |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + if (!window.eventSender) |
| + return; |
| + anchorNode = frames[1].document.getElementById("ex1"); |
| + var r = anchorNode.getBoundingClientRect(); |
| + x = (r.left + r.right) / 2 |
| + y = (r.top + r.bottom) / 2; |
| + anchorNode.focus(); |
| + eventSender.keyDown("menu"); |
| + // Esc key to hide context menu |
|
Rick Byers
2014/12/19 15:14:27
Any reason to do this twice? I'd suggest removing
Deepak
2014/12/20 09:35:33
Done.
|
| + eventSender.keyDown("escape"); |
| + eventSender.keyDown("menu"); |
| +} |
| +</script> |
| +</head> |
| + |
| +<frameset rows="30%,40%" onload="runTest()"> |
|
Rick Byers
2014/12/19 15:14:27
perhaps the frameset is necessary just to get "myf
Deepak
2014/12/20 09:35:33
I am getting uncaught reference error like below
|
| +<frame src="resources/window-opened.html"> |
| +<frame id="myframe" src="resources/menu-key-context-menu-position-frame.html"> |
| +</frameset> |
| + |
| +</html> |