Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / execCommand / clipboard-access-with-userGesture.html
blobae25430bd62c816d00110500a33bbd2f249cfae9
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script>
4 var copyEventSeen;
5 var cutEventSeen;
7 function runTest()
9 if (window.testRunner)
10 window.testRunner.setJavaScriptCanAccessClipboard(false);
11 else
12 return;
13 clickButton("copy");
14 clickButton("cut");
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");
32 function onClickCut()
34 cutEventSeend = false;
35 shouldBeTrue("document.execCommand('cut')");
36 shouldBeTrue("cutEventSeen");
39 function onCopy()
41 copyEventSeen = true;
44 function onCut()
46 cutEventSeen = true;
48 </script>
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.
51 <div>
52 <button id="copy" onclick="onClickCopy()">Copy</button>
53 <button id="cut" onclick="onClickCut()">Cut</button>
54 </div>
55 <div id="console"></div>
56 </body>