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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarTestSuite.h

Issue 2383113003: Refactor ScrollableArea::setScrollPosition. (Closed)
Patch Set: Created 4 years, 2 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ScrollbarTestSuite_h 5 #ifndef ScrollbarTestSuite_h
6 #define ScrollbarTestSuite_h 6 #define ScrollbarTestSuite_h
7 7
8 #include "platform/heap/GarbageCollected.h" 8 #include "platform/heap/GarbageCollected.h"
9 #include "platform/scroll/ScrollableArea.h" 9 #include "platform/scroll/ScrollableArea.h"
10 #include "platform/scroll/Scrollbar.h" 10 #include "platform/scroll/Scrollbar.h"
(...skipping 28 matching lines...) Expand all
39 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*()); 39 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*());
40 MOCK_CONST_METHOD1(visibleContentRect, IntRect(IncludeScrollbarsInRect)); 40 MOCK_CONST_METHOD1(visibleContentRect, IntRect(IncludeScrollbarsInRect));
41 MOCK_CONST_METHOD0(contentsSize, IntSize()); 41 MOCK_CONST_METHOD0(contentsSize, IntSize());
42 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect()); 42 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect());
43 MOCK_CONST_METHOD0(layerForHorizontalScrollbar, GraphicsLayer*()); 43 MOCK_CONST_METHOD0(layerForHorizontalScrollbar, GraphicsLayer*());
44 MOCK_CONST_METHOD0(layerForVerticalScrollbar, GraphicsLayer*()); 44 MOCK_CONST_METHOD0(layerForVerticalScrollbar, GraphicsLayer*());
45 45
46 bool userInputScrollable(ScrollbarOrientation) const override { return true; } 46 bool userInputScrollable(ScrollbarOrientation) const override { return true; }
47 bool scrollbarsCanBeActive() const override { return true; } 47 bool scrollbarsCanBeActive() const override { return true; }
48 bool shouldPlaceVerticalScrollbarOnLeft() const override { return false; } 48 bool shouldPlaceVerticalScrollbarOnLeft() const override { return false; }
49 void setScrollOffset(const DoublePoint& offset, ScrollType) override { 49 void updateScrollPosition(const DoublePoint& position, ScrollType) override {
50 m_scrollPosition = 50 m_scrollPosition =
51 flooredIntPoint(offset).shrunkTo(m_maximumScrollPosition); 51 flooredIntPoint(position).shrunkTo(m_maximumScrollPosition);
52 } 52 }
53 IntPoint scrollPosition() const override { return m_scrollPosition; } 53 IntPoint scrollPosition() const override { return m_scrollPosition; }
54 IntPoint minimumScrollPosition() const override { return IntPoint(); } 54 IntPoint minimumScrollPosition() const override { return IntPoint(); }
55 IntPoint maximumScrollPosition() const override { 55 IntPoint maximumScrollPosition() const override {
56 return m_maximumScrollPosition; 56 return m_maximumScrollPosition;
57 } 57 }
58 int visibleHeight() const override { return 768; } 58 int visibleHeight() const override { return 768; }
59 int visibleWidth() const override { return 1024; } 59 int visibleWidth() const override { return 1024; }
60 bool scrollAnimatorEnabled() const override { return false; } 60 bool scrollAnimatorEnabled() const override { return false; }
61 int pageStep(ScrollbarOrientation) const override { return 0; } 61 int pageStep(ScrollbarOrientation) const override { return 0; }
(...skipping 29 matching lines...) Expand all
91 91
92 void TearDown() override { m_fakePlatform = nullptr; } 92 void TearDown() override { m_fakePlatform = nullptr; }
93 93
94 private: 94 private:
95 std::unique_ptr<TestingPlatformSupportWithMockScheduler> m_fakePlatform; 95 std::unique_ptr<TestingPlatformSupportWithMockScheduler> m_fakePlatform;
96 }; 96 };
97 97
98 } // namespace blink 98 } // namespace blink
99 99
100 #endif 100 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698