| 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 var globalVar = { b: 1 }; | |
| 9 | |
| 10 function slave(x) | |
| 11 { | |
| 12 var y = 20; | |
| 13 debugger; | |
| 14 } | |
| 15 | |
| 16 function testFunction() | |
| 17 { | |
| 18 var localObject = { a: 300 }; | |
| 19 slave(4000); | |
| 20 } | |
| 21 | |
| 22 var test = function() | |
| 23 { | |
| 24 InspectorTest.startDebuggerTest(step1); | |
| 25 | |
| 26 function step1() | |
| 27 { | |
| 28 InspectorTest.runTestFunctionAndWaitUntilPaused(step2); | |
| 29 } | |
| 30 | |
| 31 function step2(callFrames) | |
| 32 { | |
| 33 InspectorTest.evaluateInConsole("x + y + globalVar.b", step3.bind(null,
callFrames)); | |
| 34 } | |
| 35 | |
| 36 function step3(callFrames, result) | |
| 37 { | |
| 38 InspectorTest.addResult("Evaluated script on the top frame: " + result); | |
| 39 var pane = WebInspector.panels.sources.sidebarPanes.callstack; | |
| 40 pane._callFrameSelected(pane.callFrames[1]); | |
| 41 InspectorTest.runAfterPendingDispatches(step4); | |
| 42 } | |
| 43 | |
| 44 function step4() | |
| 45 { | |
| 46 InspectorTest.evaluateInConsole("localObject.a + globalVar.b", step5); | |
| 47 } | |
| 48 | |
| 49 function step5(result) | |
| 50 { | |
| 51 InspectorTest.addResult("Evaluated script on the calling frame: " + resu
lt); | |
| 52 InspectorTest.completeDebuggerTest(); | |
| 53 } | |
| 54 } | |
| 55 | |
| 56 </script> | |
| 57 </head> | |
| 58 | |
| 59 <body onload="runTest()"> | |
| 60 <p> | |
| 61 Tests that evaluation in console works fine when script is paused. It also check
s that | |
| 62 stack and global variables are accessible from the console. | |
| 63 </p> | |
| 64 | |
| 65 </body> | |
| 66 </html> | |
| OLD | NEW |