| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script type="text/javascript" src="resources/statements.js"></script> | 4 <script type="text/javascript" src="resources/statements.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var scenario = [ | 9 var scenario = [ |
| 10 // requested line number, insterstatement location, expected control par
ameter 'step', expected line number | 10 // requested line number, insterstatement location, expected control par
ameter 'step', expected line number |
| 11 [ 8, false, 1, 8 ], | 11 [ 8, false, 1, 8 ], |
| 12 [ 8, true, 1, 8 ], | 12 [ 8, true, 1, 8 ], |
| 13 [ 12, false, 6, 17 ], | 13 [ 12, false, 6, 17 ], |
| 14 [ 13, false, 6, 17 ], | 14 [ 13, false, 6, 17 ], |
| 15 [ 17, false, 6, 17 ], | 15 [ 17, false, 6, 17 ], |
| 16 [ 17, true, 6, 17 ], | 16 [ 17, true, 6, 17 ], |
| 17 ]; | 17 ]; |
| 18 | 18 |
| 19 InspectorTest.sendCommand("Debugger.enable", {}); | 19 InspectorTest.sendCommand("Debugger.enable", {}); |
| 20 | 20 |
| 21 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "statementsExa
mple" }, callbackEvalFunctionObject); | 21 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "statementsExa
mple" }, callbackEvalFunctionObject); |
| 22 | 22 |
| 23 function callbackEvalFunctionObject(response) | 23 function callbackEvalFunctionObject(response) |
| 24 { | 24 { |
| 25 var functionObjectId = response.result.result.objectId; | 25 var functionObjectId = response.result.result.objectId; |
| 26 InspectorTest.sendCommand("Debugger.getFunctionDetails", { functionId: f
unctionObjectId }, callbackFunctionDetails); | 26 InspectorTest.sendCommand("Runtime.getProperties", { objectId: functionO
bjectId }, callbackFunctionDetails); |
| 27 } | 27 } |
| 28 | 28 |
| 29 function callbackFunctionDetails(response) | 29 function callbackFunctionDetails(response) |
| 30 { | 30 { |
| 31 var result = response.result; | 31 var result = response.result; |
| 32 var scriptId = result.details.location.scriptId; | 32 var scriptId; |
| 33 for (var prop of result.internalProperties) { |
| 34 if (prop.name === "[[FunctionLocation]]") |
| 35 scriptId = prop.value.value.scriptId; |
| 36 } |
| 33 | 37 |
| 34 nextScenarioStep(0); | 38 nextScenarioStep(0); |
| 35 | 39 |
| 36 function nextScenarioStep(pos) | 40 function nextScenarioStep(pos) |
| 37 { | 41 { |
| 38 if (pos < scenario.length) | 42 if (pos < scenario.length) |
| 39 gotoSinglePassChain(scriptId, scenario[pos][0], scenario[pos][1]
, scenario[pos][2], scenario[pos][3], nextScenarioStep.bind(this, pos + 1)); | 43 gotoSinglePassChain(scriptId, scenario[pos][0], scenario[pos][1]
, scenario[pos][2], scenario[pos][3], nextScenarioStep.bind(this, pos + 1)); |
| 40 else | 44 else |
| 41 InspectorTest.completeTest(); | 45 InspectorTest.completeTest(); |
| 42 } | 46 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 InspectorTest.log("Unexpected debugger pause"); | 94 InspectorTest.log("Unexpected debugger pause"); |
| 91 InspectorTest.completeTest(); | 95 InspectorTest.completeTest(); |
| 92 } | 96 } |
| 93 } | 97 } |
| 94 } | 98 } |
| 95 </script> | 99 </script> |
| 96 </head> | 100 </head> |
| 97 <body onLoad="runTest();"> | 101 <body onLoad="runTest();"> |
| 98 </body> | 102 </body> |
| 99 </html> | 103 </html> |
| OLD | NEW |