| 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.log("Check that console.log is reported through Console domain as
well."); | 5 let {session, contextGroup, Protocol} = InspectorTest.start("Check that console.
log is reported through Console domain as well."); |
| 6 | 6 |
| 7 var expectedMessages = 4; | 7 var expectedMessages = 4; |
| 8 var messages = []; | 8 var messages = []; |
| 9 | 9 |
| 10 Protocol.Runtime.onConsoleAPICalled(consoleAPICalled); | 10 Protocol.Runtime.onConsoleAPICalled(consoleAPICalled); |
| 11 Protocol.Console.onMessageAdded(messageAdded); | 11 Protocol.Console.onMessageAdded(messageAdded); |
| 12 Protocol.Runtime.enable(); | 12 Protocol.Runtime.enable(); |
| 13 Protocol.Console.enable(); | 13 Protocol.Console.enable(); |
| 14 Protocol.Runtime.evaluate({ "expression": "console.log(42)" }); | 14 Protocol.Runtime.evaluate({ "expression": "console.log(42)" }); |
| 15 Protocol.Runtime.evaluate({ "expression": "console.error('abc')" }); | 15 Protocol.Runtime.evaluate({ "expression": "console.error('abc')" }); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 28 done(); | 28 done(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function done() | 31 function done() |
| 32 { | 32 { |
| 33 messages.sort(); | 33 messages.sort(); |
| 34 for (var message of messages) | 34 for (var message of messages) |
| 35 InspectorTest.log(message); | 35 InspectorTest.log(message); |
| 36 InspectorTest.completeTest(); | 36 InspectorTest.completeTest(); |
| 37 } | 37 } |
| OLD | NEW |