Chromium Code Reviews| Index: cc/test/fake_compositor_proto_state_sink.h |
| diff --git a/cc/test/fake_compositor_proto_state_sink.h b/cc/test/fake_compositor_proto_state_sink.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..75440c66cb5b14f29ce46df4c969e87872aabfc0 |
| --- /dev/null |
| +++ b/cc/test/fake_compositor_proto_state_sink.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2016 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. |
| + |
| +#ifndef CC_TEST_FAKE_COMPOSITOR_PROTO_STATE_SINK_H_ |
| +#define CC_TEST_FAKE_COMPOSITOR_PROTO_STATE_SINK_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "cc/blimp/compositor_proto_state_sink.h" |
| + |
| +namespace cc { |
| + |
| +// An implementation of the CompositorStateSink for tests that pumps |
| +// BeginMainFrames as soon as the client requests them. |
| +class FakeCompositorProtoStateSink : public CompositorProtoStateSink { |
| + public: |
| + FakeCompositorProtoStateSink(); |
| + ~FakeCompositorProtoStateSink() override; |
| + |
| + // CompositorProtoStateSink implementation. |
| + void BindToClient(CompositorProtoStateSinkClient* client) override; |
| + void ScheduleMainFrame() override; |
| + void ProcessCompositorStateUpdate( |
| + std::unique_ptr<CompositorProtoState> compositor_proto_state) override{}; |
|
danakj
2016/09/26 21:36:54
git cl format? no ;
Khushal
2016/09/27 01:07:50
Done.
|
| + |
| + private: |
| + void BeginMainFrame(); |
| + |
| + CompositorProtoStateSinkClient* client_; |
| + base::WeakPtrFactory<FakeCompositorProtoStateSink> weak_factory_; |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_TEST_FAKE_COMPOSITOR_PROTO_STATE_SINK_H_ |