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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar-mainframe.html

Issue 2165763002: Fix layout tests that would fail if ScrollAnchoring was promoted to experimental (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 4 years, 5 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-scrollbar-mainframe.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar-mainframe.html b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar-mainframe.html
index b3840d2ed46520a08a0aa2ce6343639a02b933ce..e4ab9aaafe1705224eb74cd6e3513002e62c53ee 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar-mainframe.html
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar-mainframe.html
@@ -1,5 +1,6 @@
<!DOCTYPE html>
-<script src="../../../../resources/js-test.js"></script>
+<script src="../../../../resources/testharness.js"></script>
+<script src="../../../../resources/testharnessreport.js"></script>
<style>
::-webkit-scrollbar {
background-color: #ccc;
@@ -33,46 +34,39 @@ body {
// Ensure there's a candidate for touch adjustment.
document.addEventListener("click", function() {});
-function scrollTest() {
- shouldBeGreaterThan("window.innerWidth - document.body.clientWidth", "5");
- var scrollbarX = document.body.clientWidth + 5;
- var scrollbarY = window.innerHeight / 2; // Trying to grab the thumb
+test(function(t) {
+ assert_not_equals(window.eventSender, undefined, 'This test requires eventSender.');
- // Ensure we use a touch with an area to test under touch adjustment
- var touchWidth = 25;
- var touchHeight = 25;
+ //if (window.internals)
+ // internals.settings.setMockScrollbarsEnabled(true);
- // Scroll down to ensure we test the difference between content and client
- // co-ordinate spaces.
- window.scrollTo(0, 800);
- shouldBe('window.scrollY', '800');
+ assert_greater_than(window.innerWidth - document.body.clientWidth, 5);
+ var scrollbarX = document.body.clientWidth + 5;
+ var scrollbarY = window.innerHeight / 2; // Trying to grab the thumb
- if (!window.eventSender) {
- testFailed("This test requires eventSender");
- return;
- }
+ // Ensure we use a touch with an area to test under touch adjustment
+ var touchWidth = 25;
+ var touchHeight = 25;
- eventSender.gestureTapDown(scrollbarX, scrollbarY, touchWidth, touchHeight);
- eventSender.gestureShowPress(scrollbarX, scrollbarY, touchWidth, touchHeight);
- eventSender.gestureScrollBegin(scrollbarX - 20, scrollbarY, touchWidth, touchHeight);
- eventSender.gestureTapCancel(scrollbarX, scrollbarY);
- shouldBe('window.scrollY', '800');
- eventSender.gestureScrollUpdate(0, 20);
- // We don't know exactly how far draging the thumb will scroll. If we end
- // up scrolling in the wrong direction it probably means hit tests are passing
- // through the scrollbar and hitting the content.
- shouldBeGreaterThan('window.scrollY', '820');
- eventSender.gestureScrollUpdate(0, 60);
- shouldBeGreaterThan('window.scrollY', '885');
- eventSender.gestureScrollEnd(0, 0);
- shouldBeGreaterThan('window.scrollY', '885');
-}
-
-//if (window.internals)
-// internals.settings.setMockScrollbarsEnabled(true);
+ // Scroll down to ensure we test the difference between content and client
+ // co-ordinate spaces.
+ window.scrollTo(0, 800);
+ assert_equals(window.scrollY, 800);
-description('This tests scroll gesture events on main frame scroll bars. ' +
- 'The document should be slightly scrolled down if successful.');
+ eventSender.gestureTapDown(scrollbarX, scrollbarY, touchWidth, touchHeight);
+ eventSender.gestureShowPress(scrollbarX, scrollbarY, touchWidth, touchHeight);
+ eventSender.gestureScrollBegin(scrollbarX - 20, scrollbarY, touchWidth, touchHeight);
+ eventSender.gestureTapCancel(scrollbarX, scrollbarY);
+ assert_equals(window.scrollY, 800);
+ eventSender.gestureScrollUpdate(0, 20);
+ // We don't know exactly how far draging the thumb will scroll. If we end
+ // up scrolling in the wrong direction it probably means hit tests are passing
+ // through the scrollbar and hitting the content.
+ assert_greater_than(window.scrollY, 820);
+ eventSender.gestureScrollUpdate(0, 60);
+ assert_greater_than(window.scrollY, 885);
+ eventSender.gestureScrollEnd(0, 0);
+ assert_greater_than(window.scrollY, 885);
+}, 'This tests scroll gesture events on main frame scroll bars The document should be slightly scrolled down if successful.');
- scrollTest();
</script>

Powered by Google App Engine
This is Rietveld 408576698