OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../http/tests/inspector/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function handleMouseDown(event) | 7 function handleMouseDown(event) |
8 { | 8 { |
9 console.timeStamp("Handling mousedown"); | 9 console.timeStamp("Handling mousedown"); |
10 } | 10 } |
11 | 11 |
12 function performActions() | 12 function performActions() |
13 { | 13 { |
14 var target = document.getElementById("testTarget"); | 14 var target = document.getElementById("testTarget"); |
15 target.addEventListener("mousedown", handleMouseDown, true); | 15 target.addEventListener("mousedown", handleMouseDown, true); |
16 var rect = target.getBoundingClientRect(); | 16 var rect = target.getBoundingClientRect(); |
17 | 17 |
18 // Simulate the mouse down over the target to trigger an EventDispatch | 18 // Simulate the mouse down over the target to trigger an EventDispatch |
19 if (window.eventSender) { | 19 if (window.eventSender) { |
20 window.eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + re ct.height / 2); | 20 window.eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + re ct.height / 2); |
21 window.eventSender.mouseDown(); | 21 window.eventSender.mouseDown(); |
22 } | 22 } |
23 } | 23 } |
24 | 24 |
25 function test() | 25 function test() |
26 { | 26 { |
27 InspectorTest.startDumpingProtocolMessages(); | |
yurys
2014/07/24 16:58:37
Revert this.
loislo
2014/07/28 14:00:05
Done.
| |
27 InspectorTest.performActionsAndPrint("performActions()", "EventDispatch"); | 28 InspectorTest.performActionsAndPrint("performActions()", "EventDispatch"); |
28 } | 29 } |
29 | 30 |
30 </script> | 31 </script> |
31 </head> | 32 </head> |
32 | 33 |
33 <body onload="runTest()"> | 34 <body onload="runTest()"> |
34 <p> | 35 <p> |
35 Tests the Timeline API instrumentation of a DOM Dispatch (mousedown) | 36 Tests the Timeline API instrumentation of a DOM Dispatch (mousedown) |
36 </p> | 37 </p> |
37 | 38 |
38 <div id="testTarget" style="width:400px; height:400px;"> | 39 <div id="testTarget" style="width:400px; height:400px;"> |
39 Test Mouse Target | 40 Test Mouse Target |
40 </div> | 41 </div> |
41 | 42 |
42 </body> | 43 </body> |
43 </html> | 44 </html> |
OLD | NEW |