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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scroll-by-pixel.html

Issue 1557993002: Add scroll units in GestureEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test on Mac Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scroll-by-pixel.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scroll-by-pixel.html b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scroll-by-pixel.html
new file mode 100644
index 0000000000000000000000000000000000000000..7338eceaa92000dba2c0fb2e68338bc3d4a3c7d9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scroll-by-pixel.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../../resources/js-test.js"></script>
+<style type="text/css">
+::-webkit-scrollbar {
+ width: 0px;
+ height: 0px;
+}
+
+#greenbox {
+ width: 100px;
+ height: 2000px;
+ background: green;
+}
+#redbox {
+ width: 100px;
+ height: 2000px;
+ background: red;
+}
+
+</style>
+</head>
+<body style="margin:0" onload="runTest();">
+
+<div id="greenbox"></div>
+<div id="redbox"></div>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+
+function gestureScroll()
+{
+ eventSender.gestureScrollBegin("touchpad", 10, 20);
+ eventSender.gestureScrollUpdate("touchpad", 0, -100, false, "Pixels");
+ eventSender.gestureScrollUpdate("touchpad", 0, -215, false, "Pixels");
+ eventSender.gestureScrollUpdate("touchpad", 0, 20, false, "Pixels");
+ eventSender.gestureScrollEnd("touchpad", 0, 0);
+
+ shouldBecomeEqual("document.scrollingElement.scrollTop", "295", finishJSTest, 1000);
+}
+
+jsTestIsAsync = true;
+
+function runTest()
+{
+ if (window.eventSender) {
+ description('This tests gesture scrolling by non-precise pixels.');
+ gestureScroll();
+ } else {
+ debug("This test requires DumpRenderTree. Gesture-scroll the page to validate the implementation.");
+ }
+}
+</script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698