3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
6 function testFunction()
13 InspectorTest
.sendCommand("Debugger.enable", {});
15 InspectorTest
.eventHandler
["Debugger.paused"] = handleDebuggerPausedOne
;
17 InspectorTest
.sendCommand("Runtime.evaluate", { "expression": "setTimeout(testFunction, 0)" });
19 var obsoleteTopFrameId
;
21 function handleDebuggerPausedOne(messageObject
)
23 InspectorTest
.log("Paused on 'debugger;'");
25 var topFrame
= messageObject
.params
.callFrames
[0];
26 obsoleteTopFrameId
= topFrame
.callFrameId
;
28 InspectorTest
.eventHandler
["Debugger.paused"] = undefined;
30 InspectorTest
.sendCommand("Debugger.resume", { }, callbackResume
);
33 function callbackResume(response
)
35 InspectorTest
.log("resume");
36 InspectorTest
.log("restartFrame");
37 InspectorTest
.sendCommand("Debugger.restartFrame", { callFrameId
: obsoleteTopFrameId
}, callbackRestartFrame
);
40 function callbackRestartFrame(response
)
42 logErrorResponse(response
);
43 InspectorTest
.log("evaluateOnFrame");
44 InspectorTest
.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId
: obsoleteTopFrameId
, expression
: "0"} , callbackEvaluate
);
47 function callbackEvaluate(response
)
49 logErrorResponse(response
);
50 InspectorTest
.log("setVariableValue");
51 InspectorTest
.sendCommand("Debugger.setVariableValue", { callFrameId
: obsoleteTopFrameId
, scopeNumber
: 0, variableName
: "a", newValue
: { value
: 0 } }, callbackSetVariableValue
);
54 function callbackSetVariableValue(response
)
56 logErrorResponse(response
);
57 InspectorTest
.log("getStepInPositions");
58 InspectorTest
.sendCommand("Debugger.getStepInPositions", { callFrameId
: obsoleteTopFrameId
}, callbackGetStepInPositions
);
61 function callbackGetStepInPositions(response
)
63 logErrorResponse(response
);
64 InspectorTest
.completeTest();
67 function logErrorResponse(response
)
70 if (response
.error
.message
.indexOf("debugger is not on pause") != -1) {
71 InspectorTest
.log("PASS, error message as expected");
75 InspectorTest
.log("FAIL, unexpected error message");
76 InspectorTest
.log(JSON
.stringify(response
));
81 <body onLoad=
"runTest();">