Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / debugger / reveal-execution-line.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>
6 function testFunction()
7 {
8     debugger;
9 }
10
11 var test = function()
12 {
13     InspectorTest.setQuiet(true);
14     InspectorTest.runDebuggerTestSuite([
15         function testRevealAndHighlightExecutionLine(next)
16         {
17             var executionLineSet = false;
18             var executionLineRevealed = false;
19             InspectorTest.addSniffer(WebInspector.SourceFrame.prototype, "revealLine", didRevealLine);
20             InspectorTest.addSniffer(WebInspector.JavaScriptSourceFrame.prototype, "setExecutionLine", didSetExecutionLine);
21             InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
22
23             function didPaused(callFrames)
24             {
25             }
26
27             function didSetExecutionLine(line)
28             {
29                 if (executionLineSet)
30                     return;
31                 executionLineSet = true;
32                 maybeNext();
33             }
34
35             function didRevealLine(line)
36             {
37                 if (executionLineRevealed)
38                     return;
39                 if (this.isShowing()) {
40                     executionLineRevealed = true;
41                     maybeNext();
42                 }
43             }
44
45             function maybeNext()
46             {
47                 if (executionLineRevealed && executionLineSet) {
48                     InspectorTest.addResult("Execution line revealed and highlighted.");
49                     InspectorTest.resumeExecution(next);
50                 }
51             }
52         }
53     ]);
54 }
55 </script>
56 </head>
57 <body onload="runTest()">
58 <p>Tests that execution line is revealed and highlighted when debugger is paused.</p>
59 <a href="https://bugs.webkit.org/show_bug.cgi?id=80306">Bug 80306</a>
60 </body>
61 </html>