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

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: Scale the position later 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>
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+window.screenX);
28 assert_equals(event.screenY, y+window.screenY);
29 }
30
31 var testTap = async_test('Send a tap event.');
32 testTap.step(function () {
33 box.addEventListener('click', validTapResult);
34 if (window.chrome && chrome.gpuBenchmarking) {
35 chrome.gpuBenchmarking.tap(x, y, function() {
36 assert_true(receivedTap);
37 testTap.done();
38 });
39 }
40 });
41
42 }, 'Test that chrome.gpuBenchmarking.tap always taps on the expected position no matter what the screen scale factor is.');
43
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698