Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-deprecated-methods.js |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-deprecated-methods.js b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-deprecated-methods.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..186c9422ea855e4c6c96cf6cbcdee3f0c7e9aa94 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-deprecated-methods.js |
@@ -0,0 +1,23 @@ |
+(async function(testRunner) { |
+ let {page, session, dp} = await testRunner.startBlank(`Tests checks that deprecation messages for console.`); |
+ |
+ var messagesLeft = 3; |
+ dp.Runtime.onConsoleAPICalled(data => { |
+ var text = data.params.args[0].value; |
+ if (text.indexOf('deprecated') === -1) |
+ return; |
+ testRunner.log(text); |
+ if (!--messagesLeft) |
+ testRunner.completeTest(); |
+ }); |
+ |
+ dp.Runtime.enable(); |
+ var deprecatedMethods = [ |
+ `console.timeline('42')`, |
+ `console.timeline('42')`, |
+ `console.timeline('42')`, // three calls should produce one warning message |
+ `console.timelineEnd('42')`, |
+ `console.markTimeline('42')`, |
+ ]; |
+ dp.Runtime.evaluate({ expression: deprecatedMethods.join(';') }); |
+}) |