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

Side by Side Diff: test/inspector/runtime/console-line-and-column.js

Issue 2369753004: [inspector] added inspector test runner [part 5] (Closed)
Patch Set: addressed comments 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 InspectorTest.sendCommand("Runtime.enable", {});
6
7 addConsoleMessagePromise("console.log(239)")
8 .then(dumpMessage)
9 .then(() => addConsoleMessagePromise("var l = console.log;\n l(239)"))
10 .then(dumpMessage)
11 .then(() => InspectorTest.completeTest());
12
13 function addConsoleMessagePromise(expression)
14 {
15 var cb;
16 var p = new Promise((resolver) => cb = resolver);
17 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = (messageObject) => cb (messageObject);
18 InspectorTest.sendCommand("Runtime.evaluate", { expression: expression });
19 return p;
20 }
21
22 function dumpMessage(messageObject)
23 {
24 var msg = messageObject.params;
25 delete msg.executionContextId;
26 delete msg.args;
27 delete msg.timestamp;
28 for (var frame of msg.stackTrace.callFrames)
29 frame.scriptId = 0;
30 if (!frame.functionName)
31 frame.functionName = "(anonymous)";
32 if (!frame.url)
33 frame.url = "(empty)";
34 InspectorTest.logObject(msg);
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698