Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-command-line-api.html
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>
7
8 function testFunction()
9 {
10     debugger;
11 }
12
13 var test = function()
14 {
15     InspectorTest.addSniffer(WebInspector.Main.prototype, "inspect", inspect);
16     InspectorTest.addSniffer(WebInspector.Revealer, "revealPromise", oneRevealPromise, true);
17
18     function oneRevealPromise(node, revealPromise)
19     {
20         if (!(node instanceof WebInspector.RemoteObject))
21             return;
22         revealPromise.then(updateFocusedNode);
23     }
24
25     function updateFocusedNode()
26     {
27         InspectorTest.addResult("Selected node id: '" + WebInspector.panels.elements.selectedDOMNode().getAttribute("id") + "'.");
28         InspectorTest.completeDebuggerTest();
29     }
30
31     function inspect(objectId, hints)
32     {
33         InspectorTest.addResult("WebInspector.inspect called with: " + objectId.description);
34         InspectorTest.addResult("WebInspector.inspect's hints are: " + JSON.stringify(Object.keys(hints)));
35     }
36
37     InspectorTest.startDebuggerTest(step1);
38
39     function step1()
40     {
41         InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
42     }
43
44     function step2(callFrames)
45     {
46         InspectorTest.evaluateInConsoleAndDump("inspect($('#p1'))");
47     }
48 }
49
50 </script>
51 </head>
52
53 <body onload="runTest()">
54 <p id="p1">
55 Tests that inspect() command line api works while on breakpoint.
56 </p>
57
58 </body>
59 </html>