| 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 CC_TEST_REMOTE_COMPOSITOR_TEST_H_ | 5 #ifndef CC_TEST_REMOTE_COMPOSITOR_TEST_H_ |
| 6 #define CC_TEST_REMOTE_COMPOSITOR_TEST_H_ | 6 #define CC_TEST_REMOTE_COMPOSITOR_TEST_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/blimp/compositor_state_deserializer.h" | 9 #include "cc/blimp/compositor_state_deserializer.h" |
| 10 #include "cc/test/fake_image_serialization_processor.h" | 10 #include "cc/test/fake_image_serialization_processor.h" |
| 11 #include "cc/test/fake_layer_tree_host_client.h" | 11 #include "cc/test/fake_layer_tree_host_client.h" |
| 12 #include "cc/test/stub_layer_tree_host_client.h" | 12 #include "cc/test/stub_layer_tree_host_client.h" |
| 13 #include "cc/test/test_task_graph_runner.h" | 13 #include "cc/test/test_task_graph_runner.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 class AnimationHost; | 17 class AnimationHost; |
| 18 class CompositorProtoState; | 18 class CompositorProtoState; |
| 19 class FakeLayerTreeHost; | 19 class FakeLayerTreeHost; |
| 20 class FakeRemoteCompositorBridge; |
| 20 class LayerTreeHostRemote; | 21 class LayerTreeHostRemote; |
| 21 | 22 |
| 22 class RemoteCompositorTest : public testing::Test, | 23 class RemoteCompositorTest : public testing::Test, |
| 23 public CompositorStateDeserializerClient, | 24 public CompositorStateDeserializerClient, |
| 24 public FakeLayerTreeHostClient { | 25 public FakeLayerTreeHostClient { |
| 25 public: | 26 public: |
| 26 RemoteCompositorTest(); | 27 RemoteCompositorTest(); |
| 27 ~RemoteCompositorTest() override; | 28 ~RemoteCompositorTest() override; |
| 28 | 29 |
| 29 void SetUp() override; | 30 void SetUp() override; |
| 30 void TearDown() override; | 31 void TearDown() override; |
| 31 | 32 |
| 32 // CompositorStateDeserializer implementation. | 33 // CompositorStateDeserializer implementation. |
| 33 void DidUpdateLocalState() override; | 34 void DidUpdateLocalState() override; |
| 34 | 35 |
| 35 // FakeLayerTreeHostClient implementation. | 36 // FakeLayerTreeHostClient implementation. |
| 36 void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, | 37 void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta, |
| 37 const gfx::Vector2dF& outer_delta, | 38 const gfx::Vector2dF& outer_delta, |
| 38 const gfx::Vector2dF& elastic_overscroll_delta, | 39 const gfx::Vector2dF& elastic_overscroll_delta, |
| 39 float page_scale, | 40 float page_scale, |
| 40 float top_controls_delta) override; | 41 float top_controls_delta) override; |
| 41 | 42 |
| 43 bool HasPendingUpdate() const; |
| 44 |
| 42 void ProcessCompositorStateUpdate( | 45 void ProcessCompositorStateUpdate( |
| 43 std::unique_ptr<CompositorProtoState> compositor_proto_state); | 46 std::unique_ptr<CompositorProtoState> compositor_proto_state); |
| 44 | 47 |
| 45 protected: | 48 protected: |
| 46 // Engine setup. | 49 // Engine setup. |
| 47 std::unique_ptr<LayerTreeHostRemote> layer_tree_host_remote_; | 50 std::unique_ptr<LayerTreeHostRemote> layer_tree_host_remote_; |
| 48 StubLayerTreeHostClient layer_tree_host_client_remote_; | 51 StubLayerTreeHostClient layer_tree_host_client_remote_; |
| 52 FakeRemoteCompositorBridge* fake_remote_compositor_bridge_ = nullptr; |
| 49 | 53 |
| 50 // Client setup. | 54 // Client setup. |
| 51 std::unique_ptr<AnimationHost> animation_host_; | 55 std::unique_ptr<AnimationHost> animation_host_; |
| 52 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_in_process_; | 56 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_in_process_; |
| 53 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_; | 57 std::unique_ptr<CompositorStateDeserializer> compositor_state_deserializer_; |
| 54 TestTaskGraphRunner task_graph_runner_; | 58 TestTaskGraphRunner task_graph_runner_; |
| 55 | 59 |
| 56 FakeImageSerializationProcessor image_serialization_processor_; | 60 FakeImageSerializationProcessor image_serialization_processor_; |
| 57 | 61 |
| 58 bool client_state_dirty_ = false; | 62 bool client_state_dirty_ = false; |
| 59 }; | 63 }; |
| 60 | 64 |
| 61 } // namespace cc | 65 } // namespace cc |
| 62 | 66 |
| 63 #endif // CC_TEST_REMOTE_COMPOSITOR_TEST_H_ | 67 #endif // CC_TEST_REMOTE_COMPOSITOR_TEST_H_ |
| OLD | NEW |