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

Side by Side Diff: Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp

Issue 16982005: Allow objects without scrollbars to be scrollable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CR Fixes Created 7 years, 6 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
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 MOCK_METHOD1(setScrollOffsetFromAnimation, void(const IntPoint&)); 62 MOCK_METHOD1(setScrollOffsetFromAnimation, void(const IntPoint&));
63 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*()); 63 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*());
64 MOCK_CONST_METHOD0(minimumScrollPosition, IntPoint()); 64 MOCK_CONST_METHOD0(minimumScrollPosition, IntPoint());
65 MOCK_CONST_METHOD0(maximumScrollPosition, IntPoint()); 65 MOCK_CONST_METHOD0(maximumScrollPosition, IntPoint());
66 MOCK_CONST_METHOD1(visibleContentRect, IntRect(VisibleContentRectIncludesScr ollbars)); 66 MOCK_CONST_METHOD1(visibleContentRect, IntRect(VisibleContentRectIncludesScr ollbars));
67 MOCK_CONST_METHOD0(contentsSize, IntSize()); 67 MOCK_CONST_METHOD0(contentsSize, IntSize());
68 MOCK_CONST_METHOD0(overhangAmount, IntSize()); 68 MOCK_CONST_METHOD0(overhangAmount, IntSize());
69 MOCK_CONST_METHOD0(scrollbarsCanBeActive, bool()); 69 MOCK_CONST_METHOD0(scrollbarsCanBeActive, bool());
70 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect()); 70 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect());
71 71
72 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE { retu rn true; }
72 virtual IntPoint scrollPosition() const OVERRIDE { return IntPoint(); } 73 virtual IntPoint scrollPosition() const OVERRIDE { return IntPoint(); }
73 virtual int visibleHeight() const OVERRIDE { return 768; } 74 virtual int visibleHeight() const OVERRIDE { return 768; }
74 virtual int visibleWidth() const OVERRIDE { return 1024; } 75 virtual int visibleWidth() const OVERRIDE { return 1024; }
75 virtual bool scrollAnimatorEnabled() const OVERRIDE { return m_scrollAnimato rEnabled; } 76 virtual bool scrollAnimatorEnabled() const OVERRIDE { return m_scrollAnimato rEnabled; }
76 77
77 private: 78 private:
78 bool m_scrollAnimatorEnabled; 79 bool m_scrollAnimatorEnabled;
79 }; 80 };
80 81
81 class MockScrollAnimatorNone : public ScrollAnimatorNone { 82 class MockScrollAnimatorNone : public ScrollAnimatorNone {
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 EXPECT_TRUE(result); 1040 EXPECT_TRUE(result);
1040 result = result && animateScroll(t); 1041 result = result && animateScroll(t);
1041 double after = m_currentPosition; 1042 double after = m_currentPosition;
1042 EXPECT_GE(before, after); 1043 EXPECT_GE(before, after);
1043 1044
1044 t += kAnimationTime; 1045 t += kAnimationTime;
1045 for (; result && t < kEndTime; t += kAnimationTime) 1046 for (; result && t < kEndTime; t += kAnimationTime)
1046 result = result && animateScroll(t); 1047 result = result && animateScroll(t);
1047 EXPECT_GE(before, m_currentPosition); 1048 EXPECT_GE(before, m_currentPosition);
1048 } 1049 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698