| Index: third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-shadow-text.html b/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html
|
| similarity index 59%
|
| copy from third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-shadow-text.html
|
| copy to third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html
|
| index b181dd427f217a482db266ac863f96f2214cdb61..9381c1dbfd146c695861361124d7754e00cfa260 100644
|
| --- a/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-shadow-text.html
|
| +++ b/third_party/WebKit/LayoutTests/inspector/elements/inspect-mode-after-profiling.html
|
| @@ -2,34 +2,33 @@
|
| <head>
|
| <script src="../../http/tests/inspector/inspector-test.js"></script>
|
| <script src="../../http/tests/inspector/elements-test.js"></script>
|
| -
|
| <script>
|
|
|
| function click()
|
| {
|
| - var target = document.getElementById("host");
|
| + var target = document.getElementById("inspected");
|
| var rect = target.getBoundingClientRect();
|
| // Simulate the mouse click over the target to trigger an event dispatch.
|
| - if (window.eventSender) {
|
| - window.eventSender.mouseMoveTo(rect.left + 10, rect.top + 10);
|
| - window.eventSender.mouseDown();
|
| - window.eventSender.mouseUp();
|
| - }
|
| + eventSender.mouseMoveTo(rect.left + 10, rect.top + 10);
|
| + eventSender.mouseDown();
|
| + eventSender.mouseUp();
|
| }
|
|
|
| function test()
|
| {
|
| - InspectorTest.domModel.setInspectMode(DOMAgent.InspectMode.SearchForNode, step2);
|
| + InspectorTest.cpuProfilerModel.startRecording();
|
| + InspectorTest.cpuProfilerModel.stopRecording();
|
| + InspectorTest.domModel.setInspectMode(DOMAgent.InspectMode.SearchForNode, clickAtInspected);
|
|
|
| - function step2()
|
| + function clickAtInspected()
|
| {
|
| - InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3);
|
| + InspectorTest.firstElementsTreeOutline().addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish);
|
| InspectorTest.evaluateInPage("click()");
|
| }
|
|
|
| - function step3()
|
| + function dumpAndFinish()
|
| {
|
| - InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step3);
|
| + InspectorTest.firstElementsTreeOutline().removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, dumpAndFinish);
|
| var selectedElement = InspectorTest.firstElementsTreeOutline().selectedTreeElement;
|
| InspectorTest.addResult("Node selected: " + selectedElement.node().getAttribute("id"));
|
| InspectorTest.completeTest();
|
| @@ -40,15 +39,9 @@ function test()
|
| </head>
|
|
|
| <body onload="runTest()">
|
| -
|
| -<p>Test that devtools can inspect text element under shadow root.</p>
|
| -
|
| -<div><div><div id="host"></div></div></div>
|
| -<script>
|
| - var host = document.querySelector('#host');
|
| - var sr = host.createShadowRoot();
|
| - sr.innerHTML = "Text Text Text<br>Text Text Text";
|
| -</script>
|
| -
|
| +<p>
|
| +Tests that inspect mode works after profiling start/stop.
|
| +</p>
|
| +<div id="inspected" style="width:100px;height:100px;"></div>
|
| </body>
|
| </html>
|
|
|