Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / debugger / access-obsolete-frame.html
blobbd1f320694f7780d56f0198b8875edb0a5116c01
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script>
6 function testFunction()
8 debugger;
11 function test()
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)
69 if (response.error) {
70 if (response.error.message.indexOf("debugger is not on pause") != -1) {
71 InspectorTest.log("PASS, error message as expected");
72 return;
75 InspectorTest.log("FAIL, unexpected error message");
76 InspectorTest.log(JSON.stringify(response));
79 </script>
80 </head>
81 <body onLoad="runTest();">
82 </body>
83 </html>