Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-return-value.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
7 function d()
8 {
9     var i = 10;
10     return i;
11 }
12
13 function testFunction()
14 {
15     debugger;
16     return d();
17 }
18
19 var test = function()
20 {
21     InspectorTest.setQuiet(true);
22     InspectorTest.startDebuggerTest(step1);
23
24     function step1()
25     {
26         InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
27     }
28
29     var stepCount = 0;
30     function step2(callFrames)
31     {
32         if (stepCount < 2) {
33             for (var i = 0, frame; frame = callFrames[i]; ++i)
34                 InspectorTest.assertTrue(!frame.returnValue(), "Unexpected returnValue in frame #" + i);
35             WebInspector.panels.sources._stepOverButton.element.click();
36             InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(InspectorTest, step2));
37         } else {
38             InspectorTest.captureStackTrace(callFrames, null, { printReturnValue: true });
39             InspectorTest.completeDebuggerTest();
40         }
41         ++stepCount;
42     }
43 }
44
45 </script>
46 </head>
47
48 <body onload="runTest()">
49 <p>
50 Tests function's return value reported from backend.
51 </p>
52
53 </body>
54 </html>