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

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: rebase Created 5 years, 2 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..949bb1a9057ef8e9a8a9e1d541935d9456b434b4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/constructed-events.html
@@ -0,0 +1,16 @@
+<!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 before = performance.now();
+ let e = new eventType('test');
+ let after = performance.now();
+ assert_greater_than_equal(e.timeStamp, before, "Event timestamp should be greate that performance.now() timestamp taken before its creation");
+ assert_less_than_equal(e.timeStamp, after, "Event timestamp should be less that performance.now() timestamp taken after its creation");
+ }, `Constructed ${eventType.prototype.constructor.name} timestamp should be high resolution and have the same time origin as performance.now()`);
+}
+</script>
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | third_party/WebKit/LayoutTests/fast/events/hr-timestamp/input-events.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698