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 "cc/blimp/layer_tree_host_remote.h" | 5 #include "cc/blimp/layer_tree_host_remote.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 EXPECT_CALL(client, WillBeginMainFrame()).Times(num); \ | 25 EXPECT_CALL(client, WillBeginMainFrame()).Times(num); \ |
26 EXPECT_CALL(client, DidReceiveBeginMainFrame()).Times(num); \ | 26 EXPECT_CALL(client, DidReceiveBeginMainFrame()).Times(num); \ |
27 EXPECT_CALL(client, DidUpdateLayerTreeHost()).Times(num); \ | 27 EXPECT_CALL(client, DidUpdateLayerTreeHost()).Times(num); \ |
28 EXPECT_CALL(client, WillCommit()).Times(num); \ | 28 EXPECT_CALL(client, WillCommit()).Times(num); \ |
29 EXPECT_CALL(client, DidCommit()).Times(num); \ | 29 EXPECT_CALL(client, DidCommit()).Times(num); \ |
30 EXPECT_CALL(client, DidBeginMainFrame()).Times(num); | 30 EXPECT_CALL(client, DidBeginMainFrame()).Times(num); |
31 | 31 |
32 #define EXPECT_BEGIN_MAIN_FRAME_AND_COMMIT(client, num) \ | 32 #define EXPECT_BEGIN_MAIN_FRAME_AND_COMMIT(client, num) \ |
33 EXPECT_BEGIN_MAIN_FRAME(client, num) \ | 33 EXPECT_BEGIN_MAIN_FRAME(client, num) \ |
34 EXPECT_CALL(client, DidCommitAndDrawFrame()).Times(num); \ | 34 EXPECT_CALL(client, DidCommitAndDrawFrame()).Times(num); \ |
35 EXPECT_CALL(client, DidCompleteSwapBuffers()).Times(num); | 35 EXPECT_CALL(client, DidReceiveCompositorFrameAck()).Times(num); |
36 | 36 |
37 namespace cc { | 37 namespace cc { |
38 namespace { | 38 namespace { |
39 | 39 |
40 class UpdateTrackingRemoteCompositorBridge : public FakeRemoteCompositorBridge { | 40 class UpdateTrackingRemoteCompositorBridge : public FakeRemoteCompositorBridge { |
41 public: | 41 public: |
42 UpdateTrackingRemoteCompositorBridge( | 42 UpdateTrackingRemoteCompositorBridge( |
43 scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner) | 43 scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner) |
44 : FakeRemoteCompositorBridge(std::move(compositor_main_task_runner)) {} | 44 : FakeRemoteCompositorBridge(std::move(compositor_main_task_runner)) {} |
45 | 45 |
(...skipping 29 matching lines...) Expand all Loading... |
75 } | 75 } |
76 | 76 |
77 // LayerTreeHostClient implementation. | 77 // LayerTreeHostClient implementation. |
78 MOCK_METHOD0(WillBeginMainFrame, void()); | 78 MOCK_METHOD0(WillBeginMainFrame, void()); |
79 MOCK_METHOD0(DidBeginMainFrame, void()); | 79 MOCK_METHOD0(DidBeginMainFrame, void()); |
80 MOCK_METHOD0(DidReceiveBeginMainFrame, void()); | 80 MOCK_METHOD0(DidReceiveBeginMainFrame, void()); |
81 MOCK_METHOD0(DidUpdateLayerTreeHost, void()); | 81 MOCK_METHOD0(DidUpdateLayerTreeHost, void()); |
82 MOCK_METHOD0(WillCommit, void()); | 82 MOCK_METHOD0(WillCommit, void()); |
83 MOCK_METHOD0(DidCommit, void()); | 83 MOCK_METHOD0(DidCommit, void()); |
84 MOCK_METHOD0(DidCommitAndDrawFrame, void()); | 84 MOCK_METHOD0(DidCommitAndDrawFrame, void()); |
85 MOCK_METHOD0(DidCompleteSwapBuffers, void()); | 85 MOCK_METHOD0(DidReceiveCompositorFrameAck, void()); |
86 | 86 |
87 private: | 87 private: |
88 base::Closure update_host_callback_; | 88 base::Closure update_host_callback_; |
89 }; | 89 }; |
90 | 90 |
91 class MockLayer : public Layer { | 91 class MockLayer : public Layer { |
92 public: | 92 public: |
93 explicit MockLayer(bool update) : update_(update) {} | 93 explicit MockLayer(bool update) : update_(update) {} |
94 | 94 |
95 bool Update() override { | 95 bool Update() override { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 layer_tree_host_->SetNeedsUpdateLayers(); | 343 layer_tree_host_->SetNeedsUpdateLayers(); |
344 | 344 |
345 base::RunLoop().RunUntilIdle(); | 345 base::RunLoop().RunUntilIdle(); |
346 EXPECT_TRUE(root_layer_->did_update()); | 346 EXPECT_TRUE(root_layer_->did_update()); |
347 EXPECT_EQ(1, remote_compositor_bridge_->num_updates_received()); | 347 EXPECT_EQ(1, remote_compositor_bridge_->num_updates_received()); |
348 } | 348 } |
349 | 349 |
350 } // namespace | 350 } // namespace |
351 } // namespace cc | 351 } // namespace cc |
OLD | NEW |