| 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 "cc/animation/animation_events.h" |
| 8 #include "cc/test/layer_tree_test.h" | 9 #include "cc/test/layer_tree_test.h" |
| 9 #include "cc/trees/single_thread_proxy.h" | 10 #include "cc/trees/single_thread_proxy.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 namespace cc { | 13 namespace cc { |
| 13 | 14 |
| 14 // The ThreadedChannel tests are run only for threaded and direct mode. | 15 // The ThreadedChannel tests are run only for threaded and direct mode. |
| 15 class ThreadedChannelTest : public LayerTreeTest { | 16 class ThreadedChannelTest : public LayerTreeTest { |
| 16 protected: | 17 protected: |
| 17 ThreadedChannelTest() : calls_received_(0) {} | 18 ThreadedChannelTest() : calls_received_(0) {} |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 void AfterTest() override { EXPECT_EQ(1, calls_received_); } | 252 void AfterTest() override { EXPECT_EQ(1, calls_received_); } |
| 252 }; | 253 }; |
| 253 | 254 |
| 254 MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 255 MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
| 255 ThreadedChannelTestBeginMainFrameNotExpectedSoon); | 256 ThreadedChannelTestBeginMainFrameNotExpectedSoon); |
| 256 | 257 |
| 257 class ThreadedChannelTestSetAnimationEvents : public ThreadedChannelTest { | 258 class ThreadedChannelTestSetAnimationEvents : public ThreadedChannelTest { |
| 258 void BeginChannelTest() override { PostOnImplThread(); } | 259 void BeginChannelTest() override { PostOnImplThread(); } |
| 259 | 260 |
| 260 void StartTestOnImplThread() override { | 261 void StartTestOnImplThread() override { |
| 261 scoped_ptr<AnimationEventsVector> events( | 262 scoped_ptr<AnimationEvents> events(make_scoped_ptr(new AnimationEvents)); |
| 262 make_scoped_ptr(new AnimationEventsVector)); | |
| 263 GetProxyImplForTest()->PostAnimationEventsToMainThreadOnImplThread( | 263 GetProxyImplForTest()->PostAnimationEventsToMainThreadOnImplThread( |
| 264 std::move(events)); | 264 std::move(events)); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void ReceivedSetAnimationEvents() override { | 267 void ReceivedSetAnimationEvents() override { |
| 268 calls_received_++; | 268 calls_received_++; |
| 269 EndTest(); | 269 EndTest(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void AfterTest() override { EXPECT_EQ(1, calls_received_); } | 272 void AfterTest() override { EXPECT_EQ(1, calls_received_); } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 302 calls_received_++; | 302 calls_received_++; |
| 303 EndTest(); | 303 EndTest(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 void AfterTest() override { EXPECT_EQ(1, calls_received_); } | 306 void AfterTest() override { EXPECT_EQ(1, calls_received_); } |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 MULTI_THREAD_DIRECT_RENDERER_TEST_F(ThreadedChannelTestPageScaleAnimation); | 309 MULTI_THREAD_DIRECT_RENDERER_TEST_F(ThreadedChannelTestPageScaleAnimation); |
| 310 | 310 |
| 311 } // namespace cc | 311 } // namespace cc |
| OLD | NEW |