Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / right-click-focus.html
blob996685b40aeadf8e5e5ba7c51feb75a4da9b339d
1 <head>
2 <script>
3 function log(t) {
4 document.getElementById('console').innerHTML += t +'<br>';
7 if (window.testRunner)
8 testRunner.dumpAsText();
10 </script>
11 <body>
12 <p>Test that right-clicking on a text area properly focuses it.</p>
13 <textarea></textarea>
14 <div id=console></div>
15 <script>
16 if (window.eventSender) {
17 var elt = document.getElementsByTagName('textarea')[0];
18 eventSender.mouseMoveTo(elt.offsetLeft + 5, elt.offsetTop + 5);
19 eventSender.contextClick();
20 eventSender.keyDown("z");
21 log(document.getElementsByTagName("textarea")[0].value == "z" ? "PASS" : "FAIL: No text in textarea");
22 } else {
23 log("Please try right-clicking on the text area below, dismissing the context menu that appears, and typing some text. The caret should be visible, and typing should work.");
25 </script>