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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/wheel-fling-cancel.html

Issue 2261173005: wheel layout tests moved to fast/events/wheel folder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 description("Tests that a mouse wheel event will cancel an in progress fling gesture.");
7
8 var expectedWheelEventsOccurred = "0";
9 var actualWheelEventsOccurred = 0;
10
11 function notifyWhenFlingIsOver() {
12 if (!window.testRunner)
13 return;
14 if (eventSender.isFlinging()) {
15 window.setTimeout(notifyWhenFlingIsOver, 0);
16 return;
17 }
18 shouldBe('actualWheelEventsOccurred', expectedWheelEventsOccurred);
19 testRunner.notifyDone();
20 }
21
22 function recordWheelEvent(event)
23 {
24 shouldBe('event.clientX', "10");
25 shouldBe('event.clientY', "11");
26
27 // Test deliberately does not equality check wheelDeltas to not be fragi le in the face of curve adjustment.
28 shouldBeTrue("event.wheelDeltaX > 5");
29 shouldBeTrue("event.wheelDeltaY > 5");
30 actualWheelEventsOccurred++;
31 shouldBeTrue("actualWheelEventsOccurred == 0");
32 if (window.testRunner)
33 testRunner.notifyDone();
34 }
35
36 if (window.testRunner && window.eventSender && window.eventSender.gestureFli ngStart) {
37 eventSender.gestureFlingStart(10, 11, 1000, 1000, "touchpad");
38 window.eventSender.mouseMoveTo(100, 100);
39 window.eventSender.mouseScrollBy(0, 1);
40 document.addEventListener("mousewheel", recordWheelEvent);
41 testRunner.waitUntilDone();
42 notifyWhenFlingIsOver();
43 }
44
45 </script>
46 </head>
47 <body>
48 <span id="e"></span>
49 <span id="f"></span>
50 </body>
51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698