Web Inspector: Execution line in selected call frame should keep showing after toggli...
[WebKit-https.git] / LayoutTests / inspector / debugger / selected-call-frame-after-formatting-source.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../../http/tests/inspector/elements-test.js"></script>
6 <script>
7 function testFunction()
8 {
9     return testFunction2();
10 }
11
12 function testFunction2()
13 {
14     var x = Math.sqrt(10);
15     debugger;
16     return x;
17 }
18
19 var test = function()
20 {
21     InspectorTest.startDebuggerTest(step1);
22     var panel = WebInspector.panels.scripts;
23
24     function step1()
25     {
26         var testName = WebInspector.mainResource.url;
27         testName = testName.substring(testName.lastIndexOf('/') + 1);
28         InspectorTest.showScriptSource(testName, step2);
29     }
30
31     function step2(callFrames)
32     {
33         InspectorTest.runTestFunctionAndWaitUntilPaused(step3);
34     }
35
36     function step3(callFrames)
37     {
38         WebInspector.debuggerPresentationModel.selectedCallFrame = WebInspector.debuggerPresentationModel._presentationCallFrames[1];
39         panel._toggleFormatSource();
40         InspectorTest.assertEquals("testFunction", WebInspector.debuggerPresentationModel.selectedCallFrame._callFrame.functionName);
41         panel._toggleFormatSource();
42         InspectorTest.assertEquals("testFunction", WebInspector.debuggerPresentationModel.selectedCallFrame._callFrame.functionName);
43         InspectorTest.completeDebuggerTest();
44     }
45 }
46
47 </script>
48 </head>
49 <body onload="runTest()">
50 <p>Tests selected call frame does not change when pretty-print is toggled.</p>
51 <a href="https://bugs.webkit.org/show_bug.cgi?id=70906">Bug 70906</a>
52 </body>
53 </html>