OLD | NEW |
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 "cc/trees/threaded_channel.h" | 5 #include "cc/trees/threaded_channel.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" |
8 #include "cc/animation/animation_events.h" | 9 #include "cc/animation/animation_events.h" |
9 #include "cc/test/layer_tree_test.h" | 10 #include "cc/test/layer_tree_test.h" |
10 #include "cc/trees/single_thread_proxy.h" | 11 #include "cc/trees/single_thread_proxy.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace cc { | 14 namespace cc { |
14 | 15 |
15 // The ThreadedChannel tests are run only for threaded and direct mode. | 16 // The ThreadedChannel tests are run only for threaded and direct mode. |
16 class ThreadedChannelTest : public LayerTreeTest { | 17 class ThreadedChannelTest : public LayerTreeTest { |
17 protected: | 18 protected: |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 void AfterTest() override { EXPECT_EQ(1, calls_received_); } | 237 void AfterTest() override { EXPECT_EQ(1, calls_received_); } |
237 }; | 238 }; |
238 | 239 |
239 MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 240 MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
240 ThreadedChannelTestBeginMainFrameNotExpectedSoon); | 241 ThreadedChannelTestBeginMainFrameNotExpectedSoon); |
241 | 242 |
242 class ThreadedChannelTestSetAnimationEvents : public ThreadedChannelTest { | 243 class ThreadedChannelTestSetAnimationEvents : public ThreadedChannelTest { |
243 void BeginChannelTest() override { PostOnImplThread(); } | 244 void BeginChannelTest() override { PostOnImplThread(); } |
244 | 245 |
245 void StartTestOnImplThread() override { | 246 void StartTestOnImplThread() override { |
246 scoped_ptr<AnimationEvents> events(make_scoped_ptr(new AnimationEvents)); | 247 std::unique_ptr<AnimationEvents> events( |
| 248 base::WrapUnique(new AnimationEvents)); |
247 GetProxyImplForTest()->PostAnimationEventsToMainThreadOnImplThread( | 249 GetProxyImplForTest()->PostAnimationEventsToMainThreadOnImplThread( |
248 std::move(events)); | 250 std::move(events)); |
249 } | 251 } |
250 | 252 |
251 void ReceivedSetAnimationEvents() override { | 253 void ReceivedSetAnimationEvents() override { |
252 calls_received_++; | 254 calls_received_++; |
253 EndTest(); | 255 EndTest(); |
254 } | 256 } |
255 | 257 |
256 void AfterTest() override { EXPECT_EQ(1, calls_received_); } | 258 void AfterTest() override { EXPECT_EQ(1, calls_received_); } |
(...skipping 29 matching lines...) Expand all Loading... |
286 calls_received_++; | 288 calls_received_++; |
287 EndTest(); | 289 EndTest(); |
288 } | 290 } |
289 | 291 |
290 void AfterTest() override { EXPECT_EQ(1, calls_received_); } | 292 void AfterTest() override { EXPECT_EQ(1, calls_received_); } |
291 }; | 293 }; |
292 | 294 |
293 MULTI_THREAD_DIRECT_RENDERER_TEST_F(ThreadedChannelTestPageScaleAnimation); | 295 MULTI_THREAD_DIRECT_RENDERER_TEST_F(ThreadedChannelTestPageScaleAnimation); |
294 | 296 |
295 } // namespace cc | 297 } // namespace cc |
OLD | NEW |