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>
8 var globalVar
= { b
: 1 };
16 function testFunction()
18 var localObject
= { a
: 300 };
24 InspectorTest
.startDebuggerTest(step1
);
28 InspectorTest
.runTestFunctionAndWaitUntilPaused(step2
);
31 function step2(callFrames
)
33 InspectorTest
.evaluateInConsole("x + y + globalVar.b", step3
.bind(null, callFrames
));
36 function step3(callFrames
, result
)
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
);
46 InspectorTest
.evaluateInConsole("localObject.a + globalVar.b", step5
);
49 function step5(result
)
51 InspectorTest
.addResult("Evaluated script on the calling frame: " + result
);
52 InspectorTest
.completeDebuggerTest();
59 <body onload=
"runTest()">
61 Tests that evaluation in console works fine when script is paused. It also checks that
62 stack and global variables are accessible from the console.