Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-console / debugger-command-line-api.html
blob61995fcdbdb79b18ffd4e4c96d93869cb8fc8139
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/console-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script>
8 function testFunction()
10 debugger;
13 var test = function()
15 InspectorTest.addSniffer(WebInspector.Main.prototype, "inspect", inspect);
16 InspectorTest.addSniffer(WebInspector.Revealer, "revealPromise", oneRevealPromise, true);
18 function oneRevealPromise(node, revealPromise)
20 if (!(node instanceof WebInspector.RemoteObject))
21 return;
22 revealPromise.then(updateFocusedNode);
25 function updateFocusedNode()
27 InspectorTest.addResult("Selected node id: '" + WebInspector.panels.elements.selectedDOMNode().getAttribute("id") + "'.");
28 InspectorTest.completeDebuggerTest();
31 function inspect(objectId, hints)
33 InspectorTest.addResult("WebInspector.inspect called with: " + objectId.description);
34 InspectorTest.addResult("WebInspector.inspect's hints are: " + JSON.stringify(Object.keys(hints)));
37 InspectorTest.startDebuggerTest(step1);
39 function step1()
41 InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
44 function step2(callFrames)
46 InspectorTest.evaluateInConsoleAndDump("inspect($('#p1'))");
50 </script>
51 </head>
53 <body onload="runTest()">
54 <p id="p1">
55 Tests that inspect() command line api works while on breakpoint.
56 </p>
58 </body>
59 </html>