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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/synthetic-events/tap-on-scaled-screen.html

Issue 2269483002: Set the coordinates of the synthetic touch event correctly in SyntheticGestureTargetAura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
bokan 2016/08/24 15:56:57 please use <!DOCTYPE html>
lanwei 2016/08/25 02:28:56 Done.
2 <script src='../../../resources/testharness.js'></script>
3 <script src='../../../resources/testharnessreport.js'></script>
4 <style type="text/css">
5 #box {
6 width: 300px;
7 height: 100px;
8 }
9 </style>
10 <div id="box" ></div>
11
12 <script type="text/javascript">
13
14 test(function(t) {
15 var receivedTap = false;
16 var box = document.getElementById('box');
17 var targetRect = box.getBoundingClientRect();
18 var offset = 50;
19 var x = targetRect.left + offset;
20 var y = targetRect.top + offset;
21
22 function validTapResult(event) {
23 receivedTap = true;
24 assert_equals(event.target.id, "box");
25 assert_equals(event.clientX, x);
26 assert_equals(event.clientY, y);
27 assert_equals(event.screenX, x);
bokan 2016/08/24 15:56:57 This will only work if the window is at the top le
lanwei 2016/08/25 02:28:56 Acknowledged.
28 assert_equals(event.screenY, y);
29 }
30
31 //function tap() {
tdresser 2016/08/24 12:27:49 Remove commented out line (and below).
lanwei 2016/08/25 02:28:56 Done.
32 var testTap = async_test('Send a tap event.');
33 testTap.step(function () {
34 box.addEventListener('click', validTapResult);
35 if (window.chrome && chrome.gpuBenchmarking) {
36 chrome.gpuBenchmarking.tap(x, y, function() {
37 assert_true(receivedTap);
38 testTap.done();});
tdresser 2016/08/24 12:27:49 I think we'd normally put }); on the line below.
lanwei 2016/08/25 02:28:56 Done.
39 }
40 });
41 //}
42
43 }, 'Test that chrome.gpuBenchmarking.tap always taps on the expected position no matter what the screen scale factor is.');
44
45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698