| 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/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function click() | 7 function click() |
| 8 { | 8 { |
| 9 var target = document.getElementById("inspected"); | 9 var target = document.getElementById("inspected"); |
| 10 var rect = target.getBoundingClientRect(); | 10 var rect = target.getBoundingClientRect(); |
| 11 // Simulate the mouse click over the target to trigger an event dispatch. | 11 // Simulate the mouse click over the target to trigger an event dispatch. |
| 12 eventSender.mouseMoveTo(rect.left + 10, rect.top + 10); | 12 eventSender.mouseMoveTo(rect.left + 10, rect.top + 10); |
| 13 eventSender.mouseDown(); | 13 eventSender.mouseDown(); |
| 14 eventSender.mouseUp(); | 14 eventSender.mouseUp(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 function test() | 17 function test() |
| 18 { | 18 { |
| 19 InspectorTest.cpuProfilerModel.startRecording(); | 19 InspectorTest.cpuProfilerModel.startRecording(); |
| 20 InspectorTest.cpuProfilerModel.stopRecording(); | 20 InspectorTest.cpuProfilerModel.stopRecording(); |
| 21 InspectorTest.domModel.setInspectMode(Protocol.DOM.InspectMode.SearchForNode
, clickAtInspected); | 21 InspectorTest.overlayModel.setInspectMode(Protocol.Overlay.InspectMode.Searc
hForNode).then(clickAtInspected); |
| 22 | 22 |
| 23 function clickAtInspected() | 23 function clickAtInspected() |
| 24 { | 24 { |
| 25 InspectorTest.firstElementsTreeOutline().addEventListener(Elements.Eleme
ntsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); | 25 InspectorTest.firstElementsTreeOutline().addEventListener(Elements.Eleme
ntsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); |
| 26 InspectorTest.evaluateInPage("click()"); | 26 InspectorTest.evaluateInPage("click()"); |
| 27 } | 27 } |
| 28 | 28 |
| 29 function dumpAndFinish() | 29 function dumpAndFinish() |
| 30 { | 30 { |
| 31 InspectorTest.firstElementsTreeOutline().removeEventListener(Elements.El
ementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); | 31 InspectorTest.firstElementsTreeOutline().removeEventListener(Elements.El
ementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish); |
| 32 var selectedElement = InspectorTest.firstElementsTreeOutline().selectedT
reeElement; | 32 var selectedElement = InspectorTest.firstElementsTreeOutline().selectedT
reeElement; |
| 33 InspectorTest.addResult("Node selected: " + selectedElement.node().getAt
tribute("id")); | 33 InspectorTest.addResult("Node selected: " + selectedElement.node().getAt
tribute("id")); |
| 34 InspectorTest.completeTest(); | 34 InspectorTest.completeTest(); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 </script> | 38 </script> |
| 39 </head> | 39 </head> |
| 40 | 40 |
| 41 <body onload="runTest()"> | 41 <body onload="runTest()"> |
| 42 <p> | 42 <p> |
| 43 Tests that inspect mode works after profiling start/stop. | 43 Tests that inspect mode works after profiling start/stop. |
| 44 </p> | 44 </p> |
| 45 <div id="inspected" style="width:100px;height:100px;"></div> | 45 <div id="inspected" style="width:100px;height:100px;"></div> |
| 46 </body> | 46 </body> |
| 47 </html> | 47 </html> |
| OLD | NEW |