Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / async-callstack-eval.html
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/console-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script>
7
8 var a = "FAIL";
9 function testFunction()
10 {
11     var a = "PASS";
12     function inner()
13     {
14         var b = a || "FAIL";
15         setTimeout(timeout, 0);
16     }
17     inner();
18
19     a = b = "FAIL: re-assigned";
20 }
21
22 function timeout()
23 {
24     var b = "FAIL";
25     debugger;
26 }
27
28 var test = function()
29 {
30     var maxAsyncCallStackDepth = 4;
31
32     InspectorTest.setQuiet(true);
33     InspectorTest.startDebuggerTest(step1);
34
35     function step1()
36     {
37         DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
38     }
39
40     function step2()
41     {
42         InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
43     }
44
45     function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
46     {
47         InspectorTest.captureStackTrace(callFrames, asyncStackTrace);
48
49         var pane = WebInspector.panels.sources.sidebarPanes.callstack;
50         InspectorTest.addResult("Select call frame: " + pane.placards[1].title);
51         pane._placardSelected(pane.placards[1]);
52         InspectorTest.runAfterPendingDispatches(step3);
53     }
54
55     function step3()
56     {
57         InspectorTest.evaluateInConsoleAndDump("a", step4);
58     }
59
60     function step4()
61     {
62         InspectorTest.evaluateInConsoleAndDump("b", tearDown);
63     }
64
65     function tearDown()
66     {
67         InspectorTest.completeDebuggerTest();
68     }
69 }
70
71 </script>
72 </head>
73
74 <body onload="runTest()">
75 <p>
76 Tests evaluation in an async call frame.
77 </p>
78
79 </body>
80 </html>