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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 MOCK_METHOD0(DidUpdateLayerTreeHost, void()); | 86 MOCK_METHOD0(DidUpdateLayerTreeHost, void()); |
87 MOCK_METHOD5(ApplyViewportDeltas, | 87 MOCK_METHOD5(ApplyViewportDeltas, |
88 void(const gfx::Vector2dF&, | 88 void(const gfx::Vector2dF&, |
89 const gfx::Vector2dF&, | 89 const gfx::Vector2dF&, |
90 const gfx::Vector2dF&, | 90 const gfx::Vector2dF&, |
91 float, | 91 float, |
92 float)); | 92 float)); |
93 MOCK_METHOD0(WillCommit, void()); | 93 MOCK_METHOD0(WillCommit, void()); |
94 MOCK_METHOD0(DidCommit, void()); | 94 MOCK_METHOD0(DidCommit, void()); |
95 MOCK_METHOD0(DidCommitAndDrawFrame, void()); | 95 MOCK_METHOD0(DidCommitAndDrawFrame, void()); |
96 MOCK_METHOD0(DidCompleteSwapBuffers, void()); | 96 MOCK_METHOD0(DidReceiveCompositorFrameAck, void()); |
97 | 97 |
98 private: | 98 private: |
99 base::Closure update_host_callback_; | 99 base::Closure update_host_callback_; |
100 }; | 100 }; |
101 | 101 |
102 class MockLayer : public Layer { | 102 class MockLayer : public Layer { |
103 public: | 103 public: |
104 explicit MockLayer(bool update) : update_(update) {} | 104 explicit MockLayer(bool update) : update_(update) {} |
105 | 105 |
106 bool Update() override { | 106 bool Update() override { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 child_layer1->RemoveAllChildren(); | 408 child_layer1->RemoveAllChildren(); |
409 scroll_updates.clear(); | 409 scroll_updates.clear(); |
410 scroll_updates[child_layer2->id()] = gfx::ScrollOffset(3, 2); | 410 scroll_updates[child_layer2->id()] = gfx::ScrollOffset(3, 2); |
411 updates_applied = | 411 updates_applied = |
412 remote_compositor_bridge_->SendUpdates(scroll_updates, new_scale_factor); | 412 remote_compositor_bridge_->SendUpdates(scroll_updates, new_scale_factor); |
413 EXPECT_FALSE(updates_applied); | 413 EXPECT_FALSE(updates_applied); |
414 } | 414 } |
415 | 415 |
416 } // namespace | 416 } // namespace |
417 } // namespace cc | 417 } // namespace cc |
OLD | NEW |