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 print("Check that console.log doesn't run microtasks."); | 5 InspectorTest.log("Check that console.log doesn't run microtasks."); |
6 | 6 |
7 InspectorTest.addScript( | 7 InspectorTest.addScript( |
8 ` | 8 ` |
9 function testFunction() | 9 function testFunction() |
10 { | 10 { |
11 Promise.resolve().then(function(){ console.log(239); }); | 11 Promise.resolve().then(function(){ console.log(239); }); |
12 console.log(42); | 12 console.log(42); |
13 console.log(43); | 13 console.log(43); |
14 }`); | 14 }`); |
15 | 15 |
16 Protocol.Runtime.enable(); | 16 Protocol.Runtime.enable(); |
17 Protocol.Runtime.onConsoleAPICalled(messageAdded); | 17 Protocol.Runtime.onConsoleAPICalled(messageAdded); |
18 Protocol.Runtime.evaluate({ "expression": "testFunction()" }); | 18 Protocol.Runtime.evaluate({ "expression": "testFunction()" }); |
19 Protocol.Runtime.evaluate({ "expression": "setTimeout(() => console.log(\"finish
ed\"), 0)" }); | 19 Protocol.Runtime.evaluate({ "expression": "setTimeout(() => console.log(\"finish
ed\"), 0)" }); |
20 | 20 |
21 function messageAdded(result) | 21 function messageAdded(result) |
22 { | 22 { |
23 InspectorTest.logObject(result.params.args[0]); | 23 InspectorTest.logObject(result.params.args[0]); |
24 if (result.params.args[0].value === "finished") | 24 if (result.params.args[0].value === "finished") |
25 InspectorTest.completeTest(); | 25 InspectorTest.completeTest(); |
26 } | 26 } |
OLD | NEW |