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> |