| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 InspectorTest.evaluateInPage( | 5 InspectorTest.addScript( |
| 6 `function TestExpression(a, b) { | 6 `function TestExpression(a, b) { |
| 7 return a + b; | 7 return a + b; |
| 8 }`); | 8 }`); |
| 9 | 9 |
| 10 // A general-purpose engine for sending a sequence of protocol commands. | 10 // A general-purpose engine for sending a sequence of protocol commands. |
| 11 // The clients provide requests and response handlers, while the engine catches | 11 // The clients provide requests and response handlers, while the engine catches |
| 12 // errors and makes sure that once there's nothing to do completeTest() is calle
d. | 12 // errors and makes sure that once there's nothing to do completeTest() is calle
d. |
| 13 // @param step is an object with command, params and callback fields | 13 // @param step is an object with command, params and callback fields |
| 14 function runRequestSeries(step) { | 14 function runRequestSeries(step) { |
| 15 processStep(step); | 15 processStep(step); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 try { | 55 try { |
| 56 next = currentStep.callback(response.result); | 56 next = currentStep.callback(response.result); |
| 57 } catch (e) { | 57 } catch (e) { |
| 58 InspectorTest.log(e.stack); | 58 InspectorTest.log(e.stack); |
| 59 InspectorTest.completeTest(); | 59 InspectorTest.completeTest(); |
| 60 return; | 60 return; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 processStep(next); | 63 processStep(next); |
| 64 } | 64 } |
| 65 InspectorTest.sendCommand(currentStep.command, currentStep.params, innerCall
back); | 65 var command = currentStep.command.split("."); |
| 66 Protocol[command[0]][command[1]](currentStep.params).then(innerCallback); |
| 66 } | 67 } |
| 67 } | 68 } |
| 68 | 69 |
| 69 function logEqualsCheck(actual, expected) | 70 function logEqualsCheck(actual, expected) |
| 70 { | 71 { |
| 71 if (actual === expected) { | 72 if (actual === expected) { |
| 72 InspectorTest.log("PASS, result value: " + actual); | 73 InspectorTest.log("PASS, result value: " + actual); |
| 73 } else { | 74 } else { |
| 74 InspectorTest.log("FAIL, actual value: " + actual + ", expected: " + expecte
d); | 75 InspectorTest.log("FAIL, actual value: " + actual + ", expected: " + expecte
d); |
| 75 } | 76 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 143 |
| 143 function errorCallbackSetScriptSource2(result) { | 144 function errorCallbackSetScriptSource2(result) { |
| 144 var exceptionDetails = result.exceptionDetails; | 145 var exceptionDetails = result.exceptionDetails; |
| 145 logCheck("Has error reported", !!exceptionDetails); | 146 logCheck("Has error reported", !!exceptionDetails); |
| 146 logCheck("Reported error is a compile error", !!exceptionDetails); | 147 logCheck("Reported error is a compile error", !!exceptionDetails); |
| 147 if (exceptionDetails) | 148 if (exceptionDetails) |
| 148 logEqualsCheck(exceptionDetails.lineNumber, 1); | 149 logEqualsCheck(exceptionDetails.lineNumber, 1); |
| 149 return next; | 150 return next; |
| 150 } | 151 } |
| 151 } | 152 } |
| OLD | NEW |