3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
6 function addListeners()
8 window
.addEventListener("mousedown", logEvent
);
9 window
.addEventListener("mouseup", logEvent
);
10 window
.addEventListener("mousemove", logEvent
);
11 window
.addEventListener("contextmenu", logEvent
);
14 function logEvent(event
)
16 log("-----Event-----");
17 log("type: " + event
.type
);
18 log("button: " + event
.button
);
23 event
.preventDefault();
30 "type": "mousePressed",
37 "type": "mouseReleased",
45 "modifiers": 8, // shift
50 "type": "mousePressed",
57 "type": "mouseReleased",
65 InspectorTest
.evaluateInPage("addListeners();", function() {
66 for (var i
= 0; i
< events
.length
; i
++)
67 InspectorTest
.sendCommand("Input.dispatchMouseEvent", events
[i
], checkResponse
.bind(undefined, i
== events
.length
- 1));
70 function checkResponse(isLastCommand
, msg
)
73 InspectorTest
.log("Error: " + msg
.error
.message
);
75 InspectorTest
.completeTest();
81 <body onload=
"runTest()">