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