Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/input/dispatchMouseEvent.html

Issue 2961493002: [DevTools] Migrate inspector-protocol/{input,network} tests to new harness (Closed)
Patch Set: minor fixes Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource s/inspector-protocol-test.js"></script>
4 <script>
5
6 function addListeners()
7 {
8 window.addEventListener("mousedown", logEvent);
9 window.addEventListener("mouseup", logEvent);
10 window.addEventListener("mousemove", logEvent);
11 window.addEventListener("contextmenu", logEvent);
12 }
13
14 function logEvent(event)
15 {
16 log("-----Event-----");
17 log("type: " + event.type);
18 log("button: " + event.button);
19 if (event.shiftKey)
20 log("shiftKey");
21 log("x: " + event.x);
22 log("y: " + event.y);
23 event.preventDefault();
24 }
25
26 function test()
27 {
28 var events = [
29 {
30 "type": "mousePressed",
31 "button": "left",
32 "clickCount": 1,
33 "x": 100,
34 "y": 200
35 },
36 {
37 "type": "mouseReleased",
38 "button": "left",
39 "clickCount": 1,
40 "x": 100,
41 "y": 200
42 },
43 {
44 "type": "mouseMoved",
45 "modifiers": 8, // shift
46 "x": 50,
47 "y": 150
48 },
49 {
50 "type": "mousePressed",
51 "button": "right",
52 "clickCount": 1,
53 "x": 100,
54 "y": 200
55 },
56 {
57 "type": "mouseReleased",
58 "button": "right",
59 "clickCount": 1,
60 "x": 100,
61 "y": 200
62 }
63 ];
64
65 InspectorTest.evaluateInPage("addListeners();", function() {
66 for (var i = 0; i < events.length; i++)
67 InspectorTest.sendCommand("Input.dispatchMouseEvent", events[i], che ckResponse.bind(undefined, i == events.length - 1));
68 });
69
70 function checkResponse(isLastCommand, msg)
71 {
72 if (msg.error)
73 InspectorTest.log("Error: " + msg.error.message);
74 if (isLastCommand)
75 InspectorTest.completeTest();
76 }
77 }
78
79 </script>
80 </head>
81 <body onload="runTest()">
82 </body>
83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698