OLD | NEW |
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 "platform/testing/TestingPlatformSupport.h" | 12 #include "platform/testing/TestingPlatformSupport.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "wtf/PtrUtil.h" | |
15 #include <memory> | |
16 | 14 |
17 namespace blink { | 15 namespace blink { |
18 | 16 |
19 class MockScrollableArea : public GarbageCollectedFinalized<MockScrollableArea>,
public ScrollableArea { | 17 class MockScrollableArea : public GarbageCollectedFinalized<MockScrollableArea>,
public ScrollableArea { |
20 USING_GARBAGE_COLLECTED_MIXIN(MockScrollableArea); | 18 USING_GARBAGE_COLLECTED_MIXIN(MockScrollableArea); |
21 | 19 |
22 public: | 20 public: |
23 static MockScrollableArea* create() | 21 static MockScrollableArea* create() |
24 { | 22 { |
25 return new MockScrollableArea(); | 23 return new MockScrollableArea(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 }; | 82 }; |
85 | 83 |
86 class ScrollbarTestSuite : public testing::Test { | 84 class ScrollbarTestSuite : public testing::Test { |
87 public: | 85 public: |
88 ScrollbarTestSuite() {} | 86 ScrollbarTestSuite() {} |
89 | 87 |
90 void SetUp() override | 88 void SetUp() override |
91 { | 89 { |
92 TestingPlatformSupport::Config config; | 90 TestingPlatformSupport::Config config; |
93 config.compositorSupport = Platform::current()->compositorSupport(); | 91 config.compositorSupport = Platform::current()->compositorSupport(); |
94 m_fakePlatform = wrapUnique(new TestingPlatformSupportWithMockScheduler(
config)); | 92 m_fakePlatform = adoptPtr(new TestingPlatformSupportWithMockScheduler(co
nfig)); |
95 } | 93 } |
96 | 94 |
97 void TearDown() override | 95 void TearDown() override |
98 { | 96 { |
99 m_fakePlatform = nullptr; | 97 m_fakePlatform = nullptr; |
100 } | 98 } |
101 | 99 |
102 private: | 100 private: |
103 std::unique_ptr<TestingPlatformSupportWithMockScheduler> m_fakePlatform; | 101 OwnPtr<TestingPlatformSupportWithMockScheduler> m_fakePlatform; |
104 }; | 102 }; |
105 | 103 |
106 } // namespace blink | 104 } // namespace blink |
107 | 105 |
108 #endif | 106 #endif |
OLD | NEW |