Upstream version 5.34.104.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     InspectorTest.startDebuggerTest(step1, true);
23
24     function step1()
25     {
26         InspectorTest.showScriptSource("debug-inlined-scripts.html", step2);
27     }
28
29     function step2(sourceFrame)
30     {
31         InspectorTest.addResult("Script source was shown.");
32         InspectorTest.setBreakpoint(sourceFrame, 2, "", true);
33         InspectorTest.setBreakpoint(sourceFrame, 9, "", true);
34         InspectorTest.waitUntilPaused(step3);
35         InspectorTest.reloadPage(InspectorTest.completeDebuggerTest.bind(InspectorTest));
36     }
37
38     function step3(callFrames)
39     {
40         InspectorTest.addResult("Script execution paused.");
41         InspectorTest.captureStackTrace(callFrames);
42         InspectorTest.showScriptSource("debug-inlined-scripts.html", step4);
43     }
44
45     function step4(sourceFrame)
46     {
47         InspectorTest.dumpSourceFrameContents(sourceFrame);
48         InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
49     }
50
51     function step5(callFrames)
52     {
53         if (callFrames[0].location.lineNumber !== 9) {
54             InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
55             return;
56         }
57
58         InspectorTest.addResult("Script execution paused.");
59         InspectorTest.captureStackTrace(callFrames);
60         InspectorTest.showScriptSource("debug-inlined-scripts.html", step6);
61     }
62
63     function step6(sourceFrame)
64     {
65         InspectorTest.dumpSourceFrameContents(sourceFrame);
66         InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step7));
67     }
68
69     function step7()
70     {
71         InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(null, step5));
72     }
73 }
74
75 </script>
76
77 </head>
78
79 <body onload="runTest()">
80 <p>
81 Tests that all inlined scripts from the same document are shown in the same source frame with html script tags.
82 <a href="https://bugs.webkit.org/show_bug.cgi?id=54544">Bug 54544.</a>
83 </p>
84
85 </body>
86 </html>