Index: test/inspector/runtime/console-api-repeated-in-console.js |
diff --git a/test/inspector/runtime/console-api-repeated-in-console.js b/test/inspector/runtime/console-api-repeated-in-console.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..560988c7d1070dfd40c4186d8f7da7208182efeb |
--- /dev/null |
+++ b/test/inspector/runtime/console-api-repeated-in-console.js |
@@ -0,0 +1,37 @@ |
+// Copyright 2016 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+print("Check that console.log is reported through Console domain as well."); |
+ |
+var expectedMessages = 4; |
+var messages = []; |
+ |
+InspectorTest.eventHandler["Runtime.consoleAPICalled"] = consoleAPICalled; |
+InspectorTest.eventHandler["Console.messageAdded"] = messageAdded; |
+InspectorTest.sendCommandOrDie("Runtime.enable", {}); |
+InspectorTest.sendCommandOrDie("Console.enable", {}); |
+InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "console.log(42)" }); |
+InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "console.error('abc')" }); |
+ |
+function consoleAPICalled(result) |
+{ |
+ messages.push("api call: " + result.params.args[0].value); |
+ if (!(--expectedMessages)) |
+ done(); |
+} |
+ |
+function messageAdded(result) |
+{ |
+ messages.push("console message: " + result.params.message.text); |
+ if (!(--expectedMessages)) |
+ done(); |
+} |
+ |
+function done() |
+{ |
+ messages.sort(); |
+ for (var message of messages) |
+ InspectorTest.log(message); |
+ InspectorTest.completeTest(); |
+} |