OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 #include "cc/test/mock_compositor_frame_sink_support_client.h" | |
6 | |
7 using testing::Invoke; | |
8 using testing::_; | |
9 | |
10 namespace cc { | |
11 namespace test { | |
12 | |
13 MockCompositorFrameSinkSupportClient::MockCompositorFrameSinkSupportClient( | |
14 bool create_surface_during_eviction) { | |
15 ON_CALL(*this, ReclaimResources(_)) | |
16 .WillByDefault(Invoke( | |
17 this, | |
18 &MockCompositorFrameSinkSupportClient::ReclaimResourcesInternal)); | |
danakj
2017/05/05 16:04:19
no longer does anything, you can remove it
Alex Z.
2017/05/05 18:57:48
Done.
| |
19 ON_CALL(*this, DidReceiveCompositorFrameAck(_)) | |
20 .WillByDefault(Invoke( | |
21 this, | |
22 create_surface_during_eviction | |
23 ? &MockCompositorFrameSinkSupportClient::CreateSurfaceDrawCallback | |
24 : &MockCompositorFrameSinkSupportClient:: | |
25 ReclaimResourcesInternal)); | |
26 } | |
27 | |
28 MockCompositorFrameSinkSupportClient::~MockCompositorFrameSinkSupportClient() = | |
29 default; | |
30 | |
31 void MockCompositorFrameSinkSupportClient::ReclaimResourcesInternal( | |
32 const ReturnedResourceArray& resources) {} | |
danakj
2017/05/05 16:04:19
remove this method
Alex Z.
2017/05/05 18:57:48
Done.
| |
33 | |
34 void MockCompositorFrameSinkSupportClient::CreateSurfaceDrawCallback( | |
35 const ReturnedResourceArray& resources) { | |
36 LocalSurfaceId new_id(7, base::UnguessableToken::Create()); | |
37 ASSERT_TRUE(support_); | |
38 ON_CALL(*this, DidReceiveCompositorFrameAck(_)) | |
39 .WillByDefault(Invoke( | |
40 this, | |
41 &MockCompositorFrameSinkSupportClient::ReclaimResourcesInternal)); | |
42 support_->SubmitCompositorFrame(new_id, MakeCompositorFrame()); | |
43 support_->EvictFrame(); | |
44 } | |
45 | |
46 } // namespace test | |
47 | |
48 } // namespace cc | |
OLD | NEW |