Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / input / emulateTouchFromMouseEvent.html
blobfecc299b7434155081a00a66301e0146ef00d579
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script>
6 window.addEventListener("touchstart", logEvent);
7 window.addEventListener("touchend", logEvent);
8 window.addEventListener("touchmove", logEvent);
9 window.addEventListener("touchcancel", logEvent);
11 function logEvent(event)
13 event.preventDefault();
14 log("-----Event-----");
15 log("type: " + event.type);
16 if (event.shiftKey)
17 log("shiftKey");
18 log("----Touches----");
19 for (var i = 0; i < event.touches.length; i++) {
20 var touch = event.touches[i];
21 log("id: " + i);
22 log("pageX: " + touch.pageX);
23 log("pageY: " + touch.pageY);
24 log("radiusX: " + touch.radiusX);
25 log("radiusY: " + touch.radiusY);
26 log("rotationAngle: " + touch.rotationAngle);
27 log("force: " + touch.force);
29 evaluateInFrontend("onEvent();");
32 function test()
34 var events = [
36 "type": "mousePressed",
37 "button": "left",
38 "clickCount": 1,
39 "x": 100,
40 "y": 200
43 "type": "mouseMoved",
44 "button": "left",
45 "clickCount": 1,
46 "x": 100,
47 "y": 250
50 "type": "mouseReleased",
51 "button": "left",
52 "clickCount": 1,
53 "x": 100,
54 "y": 250
57 "type": "mouseMoved",
58 "button": "none",
59 "modifiers": 8, // shift
60 "x": 50,
61 "y": 150
64 "type": "mousePressed",
65 "button": "left",
66 "clickCount": 1,
67 "x": 100,
68 "y": 200
71 "type": "mouseMoved",
72 "button": "left",
73 "clickCount": 1,
74 "x": 100,
75 "y": 250
78 "type": "mouseReleased",
79 "button": "left",
80 "clickCount": 1,
81 "x": 100,
82 "y": 250
86 var time = Number(new Date()) / 1000;
87 var index = 0;
89 function sendNextEvent() {
90 if (index === events.length) {
91 maybeFinish();
92 return;
94 var event = events[index];
95 event.timestamp = time + index;
96 index++;
97 InspectorTest.sendCommand("Input.emulateTouchFromMouseEvent", event, checkResponse);
100 function checkResponse(msg)
102 if (msg.error)
103 InspectorTest.log("Error: " + msg.error.message);
104 sendNextEvent();
107 const expectedEventCount = 6;
108 var eventCount = 0;
109 window.onEvent = function()
111 eventCount++;
112 maybeFinish();
115 function maybeFinish()
117 if (index === events.length && eventCount === expectedEventCount)
118 InspectorTest.completeTest();
121 InspectorTest.sendCommand("Page.enable", {}, function() {
122 InspectorTest.sendCommand("Page.startScreencast", {}, sendNextEvent);
126 </script>
127 </head>
128 <body onload="runTest()">
129 </body>
130 </html>