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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/hr-timestamp/input-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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script type="text/javascript">
6 'use strict';
7
8 let testCases = {
9 'mousedown': () => eventSender.mouseDown(),
10 'keydown': () => eventSender.keyDown('x'),
11 'touchstart': () => {
12 eventSender.addTouchPoint(1, 1);
13 eventSender.touchStart();
14 },
15 'click': () => eventSender.gestureTap(1, 1)
16 };
17
18 for (let eventName in testCases)
19 createTest(eventName, testCases[eventName]);
20
21 function createTest(eventName, dispatchEventFn) {
22 async_test(function(t) {
23 document.addEventListener(eventName, t.step_func(function(e) {
24 let platformTimestamp = eventSender.lastEventTimestamp(); // in seco nds
25 let expectedTimestamp = internals.monotonicTimeToZeroBasedDocumentTi me(platformTimestamp) * 1000; // in milliseconds
26 assert_approx_equals(e.timeStamp, expectedTimestamp, 0.005);
27 t.done();
28 }));
29 dispatchEventFn();
30 }, "Event timestamp should be equal to the timestamp provided by the platfor m for " + eventName);
31 }
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698