OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
4 <script> | |
5 | |
6 function test() | |
7 { | |
8 InspectorTest.sendCommand("Runtime.enable", {}); | |
9 | |
10 addConsoleMessagePromise("console.log(239)") | |
11 .then(dumpMessage) | |
12 .then(() => addConsoleMessagePromise("var l = console.log;\n l(239)")) | |
13 .then(dumpMessage) | |
14 .then(() => InspectorTest.completeTest()); | |
15 | |
16 function addConsoleMessagePromise(expression) | |
17 { | |
18 var cb; | |
19 var p = new Promise((resolver) => cb = resolver); | |
20 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = (messageObject)
=> cb(messageObject); | |
21 InspectorTest.sendCommand("Runtime.evaluate", { expression: expression }
); | |
22 return p; | |
23 } | |
24 | |
25 function dumpMessage(messageObject) | |
26 { | |
27 var msg = messageObject.params; | |
28 delete msg.executionContextId; | |
29 delete msg.args; | |
30 delete msg.timestamp; | |
31 for (var frame of msg.stackTrace.callFrames) | |
32 frame.scriptId = 0; | |
33 InspectorTest.logObject(msg); | |
34 } | |
35 } | |
36 | |
37 </script> | |
38 </head> | |
39 <body onload="runTest()"> | |
40 </body> | |
41 </html> | |
42 | |
OLD | NEW |