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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NeedsRebaselines for mac and windows etc Created 5 years, 1 month 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class MockScrollableArea : public NoBaseWillBeGarbageCollectedFinalized<MockScro llableArea>, public ScrollableArea { 47 class MockScrollableArea : public NoBaseWillBeGarbageCollectedFinalized<MockScro llableArea>, public ScrollableArea {
48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MockScrollableArea); 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MockScrollableArea);
49 public: 49 public:
50 static PassOwnPtrWillBeRawPtr<MockScrollableArea> create(bool scrollAnimator Enabled) 50 static PassOwnPtrWillBeRawPtr<MockScrollableArea> create(bool scrollAnimator Enabled)
51 { 51 {
52 return adoptPtrWillBeNoop(new MockScrollableArea(scrollAnimatorEnabled)) ; 52 return adoptPtrWillBeNoop(new MockScrollableArea(scrollAnimatorEnabled)) ;
53 } 53 }
54 54
55 MOCK_CONST_METHOD0(isActive, bool()); 55 MOCK_CONST_METHOD0(isActive, bool());
56 MOCK_CONST_METHOD1(scrollSize, int(ScrollbarOrientation)); 56 MOCK_CONST_METHOD1(scrollSize, int(ScrollbarOrientation));
57 MOCK_METHOD2(invalidateScrollbar, void(Scrollbar*, const IntRect&));
58 MOCK_CONST_METHOD0(isScrollCornerVisible, bool()); 57 MOCK_CONST_METHOD0(isScrollCornerVisible, bool());
59 MOCK_CONST_METHOD0(scrollCornerRect, IntRect()); 58 MOCK_CONST_METHOD0(scrollCornerRect, IntRect());
60 MOCK_METHOD2(setScrollOffset, void(const IntPoint&, ScrollType)); 59 MOCK_METHOD2(setScrollOffset, void(const IntPoint&, ScrollType));
61 MOCK_METHOD2(invalidateScrollbarRect, void(Scrollbar*, const IntRect&)); 60 MOCK_METHOD0(scrollControlWasSetNeedsPaintInvalidation, void());
62 MOCK_METHOD1(invalidateScrollCornerRect, void(const IntRect&));
63 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*()); 61 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*());
64 MOCK_CONST_METHOD0(minimumScrollPosition, IntPoint()); 62 MOCK_CONST_METHOD0(minimumScrollPosition, IntPoint());
65 MOCK_CONST_METHOD0(maximumScrollPosition, IntPoint()); 63 MOCK_CONST_METHOD0(maximumScrollPosition, IntPoint());
66 MOCK_CONST_METHOD1(visibleContentRect, IntRect(IncludeScrollbarsInRect)); 64 MOCK_CONST_METHOD1(visibleContentRect, IntRect(IncludeScrollbarsInRect));
67 MOCK_CONST_METHOD0(contentsSize, IntSize()); 65 MOCK_CONST_METHOD0(contentsSize, IntSize());
68 MOCK_CONST_METHOD0(scrollbarsCanBeActive, bool()); 66 MOCK_CONST_METHOD0(scrollbarsCanBeActive, bool());
69 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect()); 67 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect());
70 68
71 bool userInputScrollable(ScrollbarOrientation) const override { return true; } 69 bool userInputScrollable(ScrollbarOrientation) const override { return true; }
72 bool shouldPlaceVerticalScrollbarOnLeft() const override { return false; } 70 bool shouldPlaceVerticalScrollbarOnLeft() const override { return false; }
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 double after = m_currentPosition; 1088 double after = m_currentPosition;
1091 EXPECT_GE(before, after); 1089 EXPECT_GE(before, after);
1092 1090
1093 t += kAnimationTime; 1091 t += kAnimationTime;
1094 for (; result && t < kEndTime; t += kAnimationTime) 1092 for (; result && t < kEndTime; t += kAnimationTime)
1095 result = result && animateScroll(t); 1093 result = result && animateScroll(t);
1096 EXPECT_GE(before, m_currentPosition); 1094 EXPECT_GE(before, m_currentPosition);
1097 } 1095 }
1098 1096
1099 } // namespace blink 1097 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698