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

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

Issue 2644243002: Move ScrollableArea timer to TaskRunnerTimer. (Closed)
Patch Set: use derived class in unique_ptr Created 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "platform/scroll/ScrollbarThemeMock.h" 11 #include "platform/scroll/ScrollbarThemeMock.h"
12 #include "public/platform/Platform.h"
13 #include "public/platform/WebScheduler.h"
14 #include "public/platform/WebThread.h"
12 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
13 #include "wtf/PtrUtil.h" 16 #include "wtf/PtrUtil.h"
14 #include <memory> 17 #include <memory>
15 18
16 namespace blink { 19 namespace blink {
17 20
18 class MockScrollableArea : public GarbageCollectedFinalized<MockScrollableArea>, 21 class MockScrollableArea : public GarbageCollectedFinalized<MockScrollableArea>,
19 public ScrollableArea { 22 public ScrollableArea {
20 USING_GARBAGE_COLLECTED_MIXIN(MockScrollableArea); 23 USING_GARBAGE_COLLECTED_MIXIN(MockScrollableArea);
21 24
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 IntSize minimumScrollOffsetInt() const override { return IntSize(); } 57 IntSize minimumScrollOffsetInt() const override { return IntSize(); }
55 IntSize maximumScrollOffsetInt() const override { 58 IntSize maximumScrollOffsetInt() const override {
56 return expandedIntSize(m_maximumScrollOffset); 59 return expandedIntSize(m_maximumScrollOffset);
57 } 60 }
58 int visibleHeight() const override { return 768; } 61 int visibleHeight() const override { return 768; }
59 int visibleWidth() const override { return 1024; } 62 int visibleWidth() const override { return 1024; }
60 bool scrollAnimatorEnabled() const override { return false; } 63 bool scrollAnimatorEnabled() const override { return false; }
61 int pageStep(ScrollbarOrientation) const override { return 0; } 64 int pageStep(ScrollbarOrientation) const override { return 0; }
62 void scrollControlWasSetNeedsPaintInvalidation() {} 65 void scrollControlWasSetNeedsPaintInvalidation() {}
63 66
67 RefPtr<WebTaskRunner> getTimerTaskRunner() const final {
68 return Platform::current()->currentThread()->scheduler()->timerTaskRunner();
69 }
70
64 using ScrollableArea::horizontalScrollbarNeedsPaintInvalidation; 71 using ScrollableArea::horizontalScrollbarNeedsPaintInvalidation;
65 using ScrollableArea::verticalScrollbarNeedsPaintInvalidation; 72 using ScrollableArea::verticalScrollbarNeedsPaintInvalidation;
66 using ScrollableArea::clearNeedsPaintInvalidationForScrollControls; 73 using ScrollableArea::clearNeedsPaintInvalidationForScrollControls;
67 74
68 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); } 75 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); }
69 76
70 protected: 77 protected:
71 explicit MockScrollableArea() : m_maximumScrollOffset(ScrollOffset(0, 100)) {} 78 explicit MockScrollableArea() : m_maximumScrollOffset(ScrollOffset(0, 100)) {}
72 explicit MockScrollableArea(const ScrollOffset& offset) 79 explicit MockScrollableArea(const ScrollOffset& offset)
73 : m_maximumScrollOffset(offset) {} 80 : m_maximumScrollOffset(offset) {}
74 81
75 private: 82 private:
76 void setMaximumScrollOffset(const ScrollOffset& maximumScrollOffset) { 83 void setMaximumScrollOffset(const ScrollOffset& maximumScrollOffset) {
77 m_maximumScrollOffset = maximumScrollOffset; 84 m_maximumScrollOffset = maximumScrollOffset;
78 } 85 }
79 86
80 ScrollOffset m_scrollOffset; 87 ScrollOffset m_scrollOffset;
81 ScrollOffset m_maximumScrollOffset; 88 ScrollOffset m_maximumScrollOffset;
82 }; 89 };
83 90
84 } // namespace blink 91 } // namespace blink
85 92
86 #endif 93 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698