| <html> |
| <head> |
| <script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script> |
| <script> |
| |
| window.addEventListener("mousedown", logEvent); |
| window.addEventListener("mouseup", logEvent); |
| window.addEventListener("mousemove", logEvent); |
| |
| function logEvent(event) |
| { |
| log("-----Event-----"); |
| log("type: " + event.type); |
| log("button: " + event.button); |
| if (event.shiftKey) |
| log("shiftKey"); |
| log("x: " + event.x); |
| log("y: " + event.y); |
| } |
| |
| function test() |
| { |
| var events = [ |
| { |
| "type": "mousePressed", |
| "button": "left", |
| "clickCount": 1, |
| "x": 100, |
| "y": 200 |
| }, |
| { |
| "type": "mouseReleased", |
| "button": "left", |
| "clickCount": 1, |
| "x": 100, |
| "y": 200 |
| }, |
| { |
| "type": "mouseMoved", |
| "modifiers": 8, // shift |
| "x": 50, |
| "y": 150 |
| } |
| ]; |
| |
| for (var i = 0; i < events.length; i++) |
| InspectorTest.sendCommand("Input.dispatchMouseEvent", events[i], checkResponse.bind(undefined, i == events.length - 1)); |
| |
| function checkResponse(isLastCommand, msg) |
| { |
| if (msg.error) |
| InspectorTest.log("Error: " + msg.error.message); |
| if (isLastCommand) |
| InspectorTest.completeTest(); |
| } |
| } |
| |
| </script> |
| </head> |
| <body onload="runTest()"> |
| </body> |
| </html> |