2 <script src=
"../../resources/js-test.js"></script>
10 window
.testRunner
.setJavaScriptCanAccessClipboard(false);
17 function clickButton(id
)
19 var button
= document
.getElementById(id
);
20 eventSender
.mouseMoveTo(button
.offsetLeft
+ button
.offsetWidth
/ 2, button
.offsetTop
+ button
.offsetHeight
/ 2);
21 eventSender
.mouseDown();
22 eventSender
.mouseUp();
25 function onClickCopy()
27 copyEventSeen
= false;
28 shouldBeTrue("document.execCommand('copy')");
29 shouldBeTrue("copyEventSeen");
34 cutEventSeend
= false;
35 shouldBeTrue("document.execCommand('cut')");
36 shouldBeTrue("cutEventSeen");
49 <body onload=
"runTest()" oncopy=
"onCopy()" oncut=
"onCut()">
50 <p>To manually test, click one of the buttons below. The result should be two 'PASS' events for either button.
52 <button id=
"copy" onclick=
"onClickCopy()">Copy
</button>
53 <button id=
"cut" onclick=
"onClickCut()">Cut
</button>
55 <div id=
"console"></div>