Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-scripts.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
6 <script>
7 function test()
8 {
9     var scripts = [];
10     InspectorTest.startDebuggerTest(step1);
11
12     function step1()
13     {
14         InspectorTest.queryScripts(function(script) { step2({ data: script }) });
15         WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, step2);
16     }
17
18     function step2(event)
19     {
20         var script = event.data;
21         if (script.sourceURL !== WebInspector.inspectedPageURL)
22             return;
23         scripts.push(script);
24         if (scripts.length === 6)
25             step3();
26     }
27
28     function step3()
29     {
30         scripts.sort(function(x, y) { return x.lineOffset - y.lineOffset });
31         for (var i = 0; i < scripts.length; ++i) {
32             InspectorTest.addResult("script " + (i + 1) + ":");
33             InspectorTest.addResult("    start: " + scripts[i].lineOffset + ":" + scripts[i].columnOffset);
34             InspectorTest.addResult("    end: " + scripts[i].endLine + ":" + scripts[i].endColumn);
35         }
36         InspectorTest.completeDebuggerTest();
37     }
38 }
39 </script>    <script>
40 function f1()
41 {
42 }
43 </script>
44    <script> function f2() {}    </script>
45    <script>function f3() {}
46 </script>
47    <script>
48    function f4() {}
49 </script>
50
51 </head>
52 <body onload="window.dummy = function() { }; runTest()">
53 <p>
54 Tests that valid parsed script notifications are received by front-end.
55 <a href="https://bugs.webkit.org/show_bug.cgi?id=52721">Bug 52721</a>
56 </p>
57 </body>
58
59 </html>