Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-timestamp.js

Issue 2954093003: [DevTools] Migrate inspector-protocol/runtime tests to new harness (Closed)
Patch Set: fail: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-timestamp.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-timestamp.js b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-timestamp.js
new file mode 100644
index 0000000000000000000000000000000000000000..8c523c3920f618db6c7a6518e0773e1eb7e0ed32
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-console-timestamp.js
@@ -0,0 +1,17 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank(``);
+
+ var messages = [];
+ dp.Runtime.onConsoleAPICalled(data => {
+ var payload = data.params;
+ if (messages.length > 0)
+ testRunner.log('Message ' + messages.length + ' has non-decreasing timestamp: ' + (payload.timestamp >= messages[messages.length - 1].timestamp));
+ messages.push(payload);
+ testRunner.log('Message has timestamp: ' + !!payload.timestamp);
+ testRunner.log(`Message timestamp doesn't differ too much from current time (one minute interval): ` + (Math.abs(new Date().getTime() - payload.timestamp) < 60000));
+ if (messages.length === 3)
+ testRunner.completeTest();
+ });
+ dp.Runtime.enable();
+ dp.Runtime.evaluate({ expression: `console.log('testUnique'); for (var i = 0; i < 2; ++i) console.log('testDouble');` });
+})

Powered by Google App Engine
This is Rietveld 408576698