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

Side by Side Diff: LayoutTests/fast/events/gesture-pinch-fake-mouse-wheel.html

Issue 889803004: Add touchpad pinch zoom support to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update tests Created 5 years, 10 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/gesture-pinch-zoom.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script> 2 <script src="../../resources/js-test.js"></script>
3 <div onmousewheel="mouseWheel(event)" style="margin: 0px 0; width: 100px; height : 100px; background-color: blue;"></div> 3 <div onwheel="wheel(event)" style="margin: 0px 0; width: 100px; height: 100px; b ackground-color: blue;"></div>
4 <script> 4 <script>
5 var gotWheelEvent = false; 5 var gotWheelEvent = false;
6 var testX = 40; 6 var testX = 40;
7 var testY = 70; 7 var testY = 70;
8 var testScale = 0.5; 8 var testScale = 0.5;
9 var tolerance = 0.001; 9 var tolerance = 0.001;
10 10
11 function mouseWheel(event) 11 function wheel(event)
12 { 12 {
13 shouldBeFalse('gotWheelEvent'); 13 shouldBeFalse('gotWheelEvent');
14 gotWheelEvent = true; 14 gotWheelEvent = true;
15 shouldBeTrue('event.ctrlKey'); 15 shouldBeTrue('event.ctrlKey');
16 shouldBeCloseTo('event.deltaX', 0, tolerance); 16 shouldBeCloseTo('event.deltaX', 0, tolerance);
17 shouldBeCloseTo('event.deltaY', 100 * Math.log(1 / testScale), tolerance); 17 shouldBeCloseTo('event.deltaY', 100 * Math.log(1 / testScale), tolerance);
Rick Byers 2015/02/04 05:26:47 Oh, I forgot you already added this test! Sorry I
18 shouldBeCloseTo('event.x', testX, tolerance); 18 shouldBeCloseTo('event.x', testX, tolerance);
19 shouldBeCloseTo('event.y', testY, tolerance); 19 shouldBeCloseTo('event.y', testY, tolerance);
20 } 20 }
21 21
22 if (window.eventSender) { 22 if (window.eventSender) {
23 // Ensure that a touchpad pinch generates a synthetic event 23 // Ensure that a touchpad pinch generates a synthetic event
24 eventSender.gesturePinchBegin('touchpad', testX, testY); 24 eventSender.gesturePinchBegin('touchpad', testX, testY);
25 eventSender.gesturePinchUpdate('touchpad', testX, testY, testScale); 25 eventSender.gesturePinchUpdate('touchpad', testX, testY, testScale);
26 eventSender.gesturePinchEnd('touchpad', testX, testY); 26 eventSender.gesturePinchEnd('touchpad', testX, testY);
27 shouldBeTrue('gotWheelEvent'); 27 shouldBeTrue('gotWheelEvent');
28 } 28 }
29 </script> 29 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/gesture-pinch-zoom.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698