| OLD | NEW |
| (Empty) |
| 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 localObject1 = { a: 310 }; | |
| 17 var localObject2 = 42; | |
| 18 slave(4000); | |
| 19 } | |
| 20 | |
| 21 var test = function() | |
| 22 { | |
| 23 InspectorTest.startDebuggerTest(step1, true); | |
| 24 | |
| 25 function evalLocalVariables(callback) | |
| 26 { | |
| 27 InspectorTest.evaluateInConsoleAndDump("localObject1.a", next); | |
| 28 function next() | |
| 29 { | |
| 30 InspectorTest.evaluateInConsoleAndDump("localObject2", callback); | |
| 31 } | |
| 32 } | |
| 33 | |
| 34 function localScopeObject() | |
| 35 { | |
| 36 var pane = WebInspector.panels.sources.sidebarPanes.scopechain; | |
| 37 var localsSection = pane._sections[0]; | |
| 38 return localsSection._object; | |
| 39 } | |
| 40 | |
| 41 function step1() | |
| 42 { | |
| 43 InspectorTest.runTestFunctionAndWaitUntilPaused(step2); | |
| 44 } | |
| 45 | |
| 46 function step2(callFrames) | |
| 47 { | |
| 48 var pane = WebInspector.panels.sources.sidebarPanes.callstack; | |
| 49 pane._callFrameSelected(pane.callFrames[1]); | |
| 50 InspectorTest.runAfterPendingDispatches(step3); | |
| 51 } | |
| 52 | |
| 53 function step3() | |
| 54 { | |
| 55 InspectorTest.addResult("\nEvaluated before modification:"); | |
| 56 evalLocalVariables(step4); | |
| 57 } | |
| 58 | |
| 59 function step4() | |
| 60 { | |
| 61 localScopeObject().setPropertyValue("localObject1", "({ a: -290})", step
5); | |
| 62 } | |
| 63 | |
| 64 function step5() | |
| 65 { | |
| 66 localScopeObject().setPropertyValue({ value: "localObject2" }, "123", st
ep6); | |
| 67 } | |
| 68 | |
| 69 function step6() | |
| 70 { | |
| 71 InspectorTest.addResult("\nEvaluated after modification:"); | |
| 72 evalLocalVariables(step7); | |
| 73 } | |
| 74 | |
| 75 function step7() | |
| 76 { | |
| 77 InspectorTest.completeDebuggerTest(); | |
| 78 } | |
| 79 } | |
| 80 | |
| 81 </script> | |
| 82 </head> | |
| 83 | |
| 84 <body onload="runTest()"> | |
| 85 <p> | |
| 86 Tests that modifying local variables works fine. | |
| 87 </p> | |
| 88 </body> | |
| 89 </html> | |
| OLD | NEW |