Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-change-variable.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 function slave(x)
9 {
10     var y = 20;
11     debugger;
12 }
13
14 function testFunction()
15 {
16     var localObject = { a: 310 };
17     slave(4000);
18 }
19
20 var test = function()
21 {
22     InspectorTest.startDebuggerTest(step1);
23
24     function step1()
25     {
26         InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
27     }
28
29     function step2(callFrames)
30     {
31         var pane = WebInspector.panels.sources.sidebarPanes.callstack;
32         pane._placardSelected(pane.placards[1]);
33         InspectorTest.runAfterPendingDispatches(step3);
34     }
35
36     function step3()
37     {
38         InspectorTest.evaluateInConsole("localObject.a", step4);
39     }
40
41     function step4(result)
42     {
43         InspectorTest.addResult("Evaluated script on the calling frame: " + result);
44
45         var pane = WebInspector.panels.sources.sidebarPanes.scopechain;
46         var localsSection = pane._sections[0];
47         localsSection.object.setPropertyValue("localObject", "({ a: -290})", step5);
48     }
49
50     function step5(error)
51     {
52         if (error)
53             InspectorTest.addResult("Set property value error: " + error);
54
55         InspectorTest.evaluateInConsole("localObject.a", step6);
56     }
57
58     function step6(result)
59     {
60         InspectorTest.addResult("Evaluated script on the calling frame (after value modification): " + result);
61         InspectorTest.completeDebuggerTest();
62     }
63 }
64
65 </script>
66 </head>
67
68 <body onload="runTest()">
69 <p>
70 Tests that modifying local variables works fine.
71 </p>
72
73 </body>
74 </html>