Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / debug-inlined-scripts.html
1 <html>
2 <head>
3   <script>  function f1() { return 0; }; f1();  </script>     <script>function f2() { return 0; }</script><script>
4 function f3() { return 0; }
5 </script>
6
7 <script>
8 function f4()
9 {
10     return 0;
11 }
12 f4();
13 </script>
14
15 <script src="../../../http/tests/inspector/inspector-test.js"></script>
16 <script src="../../../http/tests/inspector/debugger-test.js"></script>
17
18 <script>
19
20 var test = function()
21 {
22     var panel = WebInspector.panels.sources;
23     InspectorTest.startDebuggerTest(step1, true);
24
25     function callstackStatus()
26     {
27         var statusElement = panel.sidebarPanes.callstack._statusMessageElement;
28         return statusElement ? statusElement.textContent : "";
29     }
30
31     function step1()
32     {
33         InspectorTest.showScriptSource("debug-inlined-scripts.html", step2);
34     }
35
36     function step2(sourceFrame)
37     {
38         InspectorTest.addResult("Script source was shown.");
39         InspectorTest.setBreakpoint(sourceFrame, 2, "", true);
40         InspectorTest.setBreakpoint(sourceFrame, 9, "", true);
41         InspectorTest.waitUntilPaused(step3);
42         InspectorTest.reloadPage(InspectorTest.completeDebuggerTest.bind(InspectorTest));
43     }
44
45     function step3(callFrames)
46     {
47         InspectorTest.addResult("Script execution paused.");
48         InspectorTest.captureStackTrace(callFrames);
49         InspectorTest.addResult("Call stack status: " + callstackStatus());
50         InspectorTest.showScriptSource("debug-inlined-scripts.html", step4);
51     }
52
53     function step4(sourceFrame)
54     {
55         InspectorTest.dumpSourceFrameContents(sourceFrame);
56         InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
57     }
58
59     function step5(callFrames)
60     {
61         if (callFrames[0].location().lineNumber !== 9) {
62             InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
63             return;
64         }
65
66         InspectorTest.addResult("Script execution paused.");
67         InspectorTest.captureStackTrace(callFrames);
68         InspectorTest.showScriptSource("debug-inlined-scripts.html", step6);
69     }
70
71     function step6(sourceFrame)
72     {
73         InspectorTest.dumpSourceFrameContents(sourceFrame);
74         InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step7));
75     }
76
77     function step7()
78     {
79         InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
80     }
81 }
82
83 </script>
84
85 </head>
86
87 <body onload="runTest()">
88 <p>
89 Tests that all inlined scripts from the same document are shown in the same source frame with html script tags.
90 <a href="https://bugs.webkit.org/show_bug.cgi?id=54544">Bug 54544.</a>
91 </p>
92
93 </body>
94 </html>