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..284afefab36c58a76419079d83a5b6c572d88677 |
--- /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 {} |
+ |
+ private: |
+ void BeginMainFrame(); |
+ |
+ CompositorProtoStateSinkClient* client_; |
+ base::WeakPtrFactory<FakeCompositorProtoStateSink> weak_factory_; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_TEST_FAKE_COMPOSITOR_PROTO_STATE_SINK_H_ |