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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 function dumpItems(object, prefix, firstLinePrefix) | 89 function dumpItems(object, prefix, firstLinePrefix) |
90 { | 90 { |
91 prefix = prefix || ""; | 91 prefix = prefix || ""; |
92 firstLinePrefix = firstLinePrefix || prefix; | 92 firstLinePrefix = firstLinePrefix || prefix; |
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 = function() | 103 InspectorTest.completeTest = function() |
104 { | 104 { |
105 Protocol.Debugger.disable().then(() => quit()); | 105 Protocol.Debugger.disable().then(() => quit()); |
106 } | 106 } |
107 | 107 |
108 InspectorTest.completeTestAfterPendingTimeouts = function() | 108 InspectorTest.completeTestAfterPendingTimeouts = function() |
109 { | 109 { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 var eventName = messageObject["method"]; | 204 var eventName = messageObject["method"]; |
205 var eventHandler = InspectorTest._eventHandler[eventName]; | 205 var eventHandler = InspectorTest._eventHandler[eventName]; |
206 if (eventHandler) | 206 if (eventHandler) |
207 eventHandler(messageObject); | 207 eventHandler(messageObject); |
208 } | 208 } |
209 } catch (e) { | 209 } catch (e) { |
210 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)); |
211 InspectorTest.completeTest(); | 211 InspectorTest.completeTest(); |
212 } | 212 } |
213 } | 213 } |
OLD | NEW |