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