Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: test/inspector/protocol-test.js

Issue 2381693002: [inspector] added a test for crash in wrapping async evaluate result (Closed)
Patch Set: a Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/inspector/runtime/evaluate-async-with-wrap-error.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 lines.push(firstLinePrefix + "["); 126 lines.push(firstLinePrefix + "[");
127 for (var i = 0; i < object.length; ++i) 127 for (var i = 0; i < object.length; ++i)
128 dumpValue(object[i], " " + prefix, " " + prefix + "[" + i + "] : "); 128 dumpValue(object[i], " " + prefix, " " + prefix + "[" + i + "] : ");
129 lines.push(prefix + "]"); 129 lines.push(prefix + "]");
130 } 130 }
131 131
132 dumpValue(object, "", title); 132 dumpValue(object, "", title);
133 InspectorTest.log(lines.join("\n")); 133 InspectorTest.log(lines.join("\n"));
134 } 134 }
135 135
136 InspectorTest.logMessage = function(message)
137 {
138 if (message.id)
139 message.id = 0;
140
141 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId"]);
142 var objects = [ message ];
143 while (objects.length) {
144 var object = objects.shift();
145 for (var key in object) {
146 if (nonStableFields.has(key))
147 object[key] = `<${key}>`;
148 else if (typeof object[key] === "object")
149 objects.push(object[key]);
150 }
151 }
152
153 InspectorTest.logObject(message);
154 return message;
155 }
156
136 InspectorTest.completeTest = quit.bind(null); 157 InspectorTest.completeTest = quit.bind(null);
137 158
138 InspectorTest.evaluateInPage = function(string, callback) 159 InspectorTest.evaluateInPage = function(string, callback)
139 { 160 {
140 InspectorTest.sendCommand("Runtime.evaluate", { "expression": string }, functi on(message) { 161 InspectorTest.sendCommand("Runtime.evaluate", { "expression": string }, functi on(message) {
141 if (message.error) { 162 if (message.error) {
142 InspectorTest.log("Error while executing '" + string + "': " + message.err or.message); 163 InspectorTest.log("Error while executing '" + string + "': " + message.err or.message);
143 InspectorTest.completeTest(); 164 InspectorTest.completeTest();
144 } 165 }
145 else if (callback) 166 else if (callback)
(...skipping 22 matching lines...) Expand all
168 if (!testSuite.length) { 189 if (!testSuite.length) {
169 InspectorTest.completeTest(); 190 InspectorTest.completeTest();
170 return; 191 return;
171 } 192 }
172 var fun = testSuite.shift(); 193 var fun = testSuite.shift();
173 InspectorTest.log("\nRunning test: " + fun.name); 194 InspectorTest.log("\nRunning test: " + fun.name);
174 fun(nextTest); 195 fun(nextTest);
175 } 196 }
176 nextTest(); 197 nextTest();
177 } 198 }
OLDNEW
« no previous file with comments | « no previous file | test/inspector/runtime/evaluate-async-with-wrap-error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698