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 #include <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
9 #include "cc/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
10 #include "cc/test/fake_image_serialization_processor.h" | 10 #include "cc/test/fake_image_serialization_processor.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // RemoteProtoChannel implementation | 63 // RemoteProtoChannel implementation |
64 void SetProtoReceiver(RemoteProtoChannel::ProtoReceiver* receiver) override { | 64 void SetProtoReceiver(RemoteProtoChannel::ProtoReceiver* receiver) override { |
65 receiver_ = receiver; | 65 receiver_ = receiver; |
66 } | 66 } |
67 void SendCompositorProto(const proto::CompositorMessage& proto) override {} | 67 void SendCompositorProto(const proto::CompositorMessage& proto) override {} |
68 | 68 |
69 int calls_received_; | 69 int calls_received_; |
70 TestTaskGraphRunner task_graph_runner_; | 70 TestTaskGraphRunner task_graph_runner_; |
71 LayerTreeSettings settings_; | 71 LayerTreeSettings settings_; |
72 std::unique_ptr<LayerTreeHost> layer_tree_host_; | 72 std::unique_ptr<LayerTreeHostInterface> layer_tree_host_; |
73 RemoteProtoChannel::ProtoReceiver* receiver_; | 73 RemoteProtoChannel::ProtoReceiver* receiver_; |
74 std::unique_ptr<FakeImageSerializationProcessor> | 74 std::unique_ptr<FakeImageSerializationProcessor> |
75 image_serialization_processor_; | 75 image_serialization_processor_; |
76 | 76 |
77 private: | 77 private: |
78 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostTestRemoteServer); | 78 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostTestRemoteServer); |
79 }; | 79 }; |
80 | 80 |
81 class LayerTreeHostTestRemoteServerBeginMainFrame | 81 class LayerTreeHostTestRemoteServerBeginMainFrame |
82 : public LayerTreeHostTestRemoteServer { | 82 : public LayerTreeHostTestRemoteServer { |
83 protected: | 83 protected: |
84 void BeginMainFrame(const BeginFrameArgs& args) override { | 84 void BeginMainFrame(const BeginFrameArgs& args) override { |
85 calls_received_++; | 85 calls_received_++; |
86 } | 86 } |
87 }; | 87 }; |
88 | 88 |
89 // Makes sure that the BeginMainFrame call is not aborted on the server. | 89 // Makes sure that the BeginMainFrame call is not aborted on the server. |
90 // See crbug.com/577301. | 90 // See crbug.com/577301. |
91 TEST_F(LayerTreeHostTestRemoteServerBeginMainFrame, BeginMainFrameNotAborted) { | 91 TEST_F(LayerTreeHostTestRemoteServerBeginMainFrame, BeginMainFrameNotAborted) { |
92 layer_tree_host_->SetVisible(true); | 92 layer_tree_host_->SetVisible(true); |
93 | 93 |
94 std::unique_ptr<BeginMainFrameAndCommitState> begin_frame_state; | 94 std::unique_ptr<BeginMainFrameAndCommitState> begin_frame_state; |
95 begin_frame_state.reset(new BeginMainFrameAndCommitState()); | 95 begin_frame_state.reset(new BeginMainFrameAndCommitState()); |
96 begin_frame_state->scroll_info.reset(new ScrollAndScaleSet()); | 96 begin_frame_state->scroll_info.reset(new ScrollAndScaleSet()); |
97 | 97 |
98 static_cast<ProxyMain*>(layer_tree_host_->proxy()) | 98 LayerTreeHost* layer_tree_host = |
| 99 static_cast<LayerTreeHost*>(layer_tree_host_.get()); |
| 100 static_cast<ProxyMain*>(layer_tree_host->proxy()) |
99 ->BeginMainFrame(std::move(begin_frame_state)); | 101 ->BeginMainFrame(std::move(begin_frame_state)); |
100 EXPECT_EQ(calls_received_, 1); | 102 EXPECT_EQ(calls_received_, 1); |
101 } | 103 } |
102 | 104 |
103 } // namespace | 105 } // namespace |
104 } // namespace cc | 106 } // namespace cc |
OLD | NEW |