| 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 = {}; | 5 InspectorTest = {}; |
| 6 InspectorTest._dispatchTable = new Map(); | 6 InspectorTest._dispatchTable = new Map(); |
| 7 InspectorTest._requestId = 0; | 7 InspectorTest._requestId = 0; |
| 8 InspectorTest._dumpInspectorProtocolMessages = false; | 8 InspectorTest._dumpInspectorProtocolMessages = false; |
| 9 InspectorTest._eventHandler = {}; | 9 InspectorTest._eventHandler = {}; |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 lines.push(firstLinePrefix + "["); | 93 lines.push(firstLinePrefix + "["); |
| 94 for (var i = 0; i < object.length; ++i) | 94 for (var i = 0; i < object.length; ++i) |
| 95 dumpValue(object[i], " " + prefix, " " + prefix + "[" + i + "] : "); | 95 dumpValue(object[i], " " + prefix, " " + prefix + "[" + i + "] : "); |
| 96 lines.push(prefix + "]"); | 96 lines.push(prefix + "]"); |
| 97 } | 97 } |
| 98 | 98 |
| 99 dumpValue(object, "", title); | 99 dumpValue(object, "", title); |
| 100 InspectorTest.log(lines.join("\n")); | 100 InspectorTest.log(lines.join("\n")); |
| 101 } | 101 } |
| 102 | 102 |
| 103 InspectorTest.completeTest = quit.bind(null); | 103 InspectorTest.completeTest = function() |
| 104 { |
| 105 Protocol.Debugger.disable().then(() => quit()); |
| 106 } |
| 104 | 107 |
| 105 InspectorTest.completeTestAfterPendingTimeouts = function() | 108 InspectorTest.completeTestAfterPendingTimeouts = function() |
| 106 { | 109 { |
| 107 Protocol.Runtime.evaluate({ | 110 Protocol.Runtime.evaluate({ |
| 108 expression: "new Promise(resolve => setTimeout(resolve, 0))", | 111 expression: "new Promise(resolve => setTimeout(resolve, 0))", |
| 109 awaitPromise: true }).then(InspectorTest.completeTest); | 112 awaitPromise: true }).then(InspectorTest.completeTest); |
| 110 } | 113 } |
| 111 | 114 |
| 112 InspectorTest.addScript = function(string) | 115 InspectorTest.addScript = function(string) |
| 113 { | 116 { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 var eventName = messageObject["method"]; | 204 var eventName = messageObject["method"]; |
| 202 var eventHandler = InspectorTest._eventHandler[eventName]; | 205 var eventHandler = InspectorTest._eventHandler[eventName]; |
| 203 if (eventHandler) | 206 if (eventHandler) |
| 204 eventHandler(messageObject); | 207 eventHandler(messageObject); |
| 205 } | 208 } |
| 206 } catch (e) { | 209 } catch (e) { |
| 207 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac
k + "\n message = " + JSON.stringify(messageObject, null, 2)); | 210 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac
k + "\n message = " + JSON.stringify(messageObject, null, 2)); |
| 208 InspectorTest.completeTest(); | 211 InspectorTest.completeTest(); |
| 209 } | 212 } |
| 210 } | 213 } |
| OLD | NEW |