Chromium Code Reviews| Index: cc/test/mock_compositor_frame_sink_support_client.cc |
| diff --git a/cc/test/mock_compositor_frame_sink_support_client.cc b/cc/test/mock_compositor_frame_sink_support_client.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4b8cb804ea09865c92be5198168bdb55339e798e |
| --- /dev/null |
| +++ b/cc/test/mock_compositor_frame_sink_support_client.cc |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "cc/test/mock_compositor_frame_sink_support_client.h" |
| + |
| +using testing::Invoke; |
| +using testing::_; |
| + |
| +namespace cc { |
| +namespace test { |
| + |
| +MockCompositorFrameSinkSupportClient::MockCompositorFrameSinkSupportClient( |
| + bool create_surface_during_eviction) { |
| + ON_CALL(*this, ReclaimResources(_)) |
| + .WillByDefault(Invoke( |
| + this, |
| + &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.
|
| + ON_CALL(*this, DidReceiveCompositorFrameAck(_)) |
| + .WillByDefault(Invoke( |
| + this, |
| + create_surface_during_eviction |
| + ? &MockCompositorFrameSinkSupportClient::CreateSurfaceDrawCallback |
| + : &MockCompositorFrameSinkSupportClient:: |
| + ReclaimResourcesInternal)); |
| +} |
| + |
| +MockCompositorFrameSinkSupportClient::~MockCompositorFrameSinkSupportClient() = |
| + default; |
| + |
| +void MockCompositorFrameSinkSupportClient::ReclaimResourcesInternal( |
| + const ReturnedResourceArray& resources) {} |
|
danakj
2017/05/05 16:04:19
remove this method
Alex Z.
2017/05/05 18:57:48
Done.
|
| + |
| +void MockCompositorFrameSinkSupportClient::CreateSurfaceDrawCallback( |
| + const ReturnedResourceArray& resources) { |
| + LocalSurfaceId new_id(7, base::UnguessableToken::Create()); |
| + ASSERT_TRUE(support_); |
| + ON_CALL(*this, DidReceiveCompositorFrameAck(_)) |
| + .WillByDefault(Invoke( |
| + this, |
| + &MockCompositorFrameSinkSupportClient::ReclaimResourcesInternal)); |
| + support_->SubmitCompositorFrame(new_id, MakeCompositorFrame()); |
| + support_->EvictFrame(); |
| +} |
| + |
| +} // namespace test |
| + |
| +} // namespace cc |