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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html

Issue 1352523002: Use high precision timestamp for Event.timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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/fast/events/hr-timestamp/constructed-events.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html b/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html
new file mode 100644
index 0000000000000000000000000000000000000000..b36c7998336a4c00058c537d0428750997c81011
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script type="text/javascript">
+'use strict';
+for (let eventType of [MouseEvent, KeyboardEvent, WheelEvent, GamepadEvent, FocusEvent]) {
+ test(function() {
+ let now = performance.now();
+ let e = new eventType('test');
+ assert_approx_equals(e.timeStamp, now, 0.05, "Timestamp should be within 0.05 ms of the performance.now() when it was created");
Rick Byers 2015/09/25 17:29:33 This might be too sensitive to avoid flakiness (eg
majidvp 2015/09/29 14:21:31 Makes sense. Done.
+ }, `Constructed ${eventType.prototype.constructor.name} timestamp should be high resolution and have the same time origin as performance.now()`);
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698