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

Side by Side Diff: Source/platform/scroll/ScrollableAreaTest.cpp

Issue 1303153005: Introduce WebTaskRunner Patch 3/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing #include Created 5 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "config.h" 5 #include "config.h"
6 #include "platform/scroll/ScrollableArea.h" 6 #include "platform/scroll/ScrollableArea.h"
7 7
8 #include "platform/TestingPlatformSupport.h" 8 #include "platform/TestingPlatformSupport.h"
9 #include "public/platform/Platform.h" 9 #include "public/platform/Platform.h"
10 #include "public/platform/WebScheduler.h" 10 #include "public/platform/WebScheduler.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 IntPoint m_scrollPosition; 58 IntPoint m_scrollPosition;
59 IntPoint m_maximumScrollPosition; 59 IntPoint m_maximumScrollPosition;
60 }; 60 };
61 61
62 class FakeWebThread : public WebThread { 62 class FakeWebThread : public WebThread {
63 public: 63 public:
64 FakeWebThread() { } 64 FakeWebThread() { }
65 ~FakeWebThread() override { } 65 ~FakeWebThread() override { }
66 66
67 void postTask(const WebTraceLocation&, Task*) override 67 WebTaskRunner* taskRunner() override
68 { 68 {
69 ASSERT_NOT_REACHED(); 69 ASSERT_NOT_REACHED();
70 } 70 return nullptr;
71
72 void postDelayedTask(const WebTraceLocation&, Task*, long long) override
73 {
74 ASSERT_NOT_REACHED();
75 } 71 }
76 72
77 bool isCurrentThread() const override 73 bool isCurrentThread() const override
78 { 74 {
79 ASSERT_NOT_REACHED(); 75 ASSERT_NOT_REACHED();
80 return true; 76 return true;
81 } 77 }
82 78
83 WebScheduler* scheduler() const override 79 WebScheduler* scheduler() const override
84 { 80 {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 }; 119 };
124 120
125 TEST_F(ScrollableAreaTest, ScrollAnimatorCurrentPositionShouldBeSync) 121 TEST_F(ScrollableAreaTest, ScrollAnimatorCurrentPositionShouldBeSync)
126 { 122 {
127 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea:: create(IntPoint(0, 100)); 123 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea:: create(IntPoint(0, 100));
128 scrollableArea->setScrollPosition(IntPoint(0, 10000), CompositorScroll); 124 scrollableArea->setScrollPosition(IntPoint(0, 10000), CompositorScroll);
129 EXPECT_EQ(100.0, scrollableArea->scrollAnimator()->currentPosition().y()); 125 EXPECT_EQ(100.0, scrollableArea->scrollAnimator()->currentPosition().y());
130 } 126 }
131 127
132 } // namespace blink 128 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scheduler/CancellableTaskFactoryTest.cpp ('k') | Source/platform/testing/UnitTestHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698