Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / copy-standalone-image-crash.html
blob1a15ff99ffebe83274f5d19a2a2ad8febf185e2f
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
6 var actionitems;
8 if (window.testRunner) {
9 window.testRunner.dumpAsText();
10 window.testRunner.waitUntilDone();
13 function doClick() {
14 for (var i = 0; i < actionitems.length; i++)
16 var title = actionitems[i].title;
18 if (!title)
19 break;
21 title = title.replace(/_/g,'');
23 if (title.match("Copy Image")) {
24 actionitems[i].click();
25 break;
29 document.body.innerHTML = "PASS";
31 window.testRunner.notifyDone();
34 function hideDiv() {
35 document.getElementById("DIV").style.display="none";
38 function doTest() {
39 if (!window.testRunner) {
40 document.body.addEventListener('mousedown', function () {setTimeout(hideDiv, 100)}, false);
41 return;
44 var image = document.getElementById("IMG");
46 x = image.offsetLeft + 10;
47 y = image.offsetTop + 10;
49 eventSender.mouseMoveTo(x, y);
50 actionitems = eventSender.contextClick();
52 hideDiv();
54 setTimeout(doClick, 10);
57 </script>
58 </head>
59 <body onload="doTest()">
60 This is an automated test case for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=31721">31721</a><br>
61 If you wish to test manually, mouseover to image, activate context menu, wait for the image to disappear and then click copy image.<br>
62 There should be no crash.
63 <div ID="DIV">
64 <img id="IMG" src="resources/apple.gif"/>
65 </div>
66 </body>
68 </html>