Chromium Code Reviews| Index: cc/test/fake_remote_compositor_bridge.h |
| diff --git a/cc/test/fake_remote_compositor_bridge.h b/cc/test/fake_remote_compositor_bridge.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cdc9cdfe0c88b6c2e66a3192db59048832bf4419 |
| --- /dev/null |
| +++ b/cc/test/fake_remote_compositor_bridge.h |
| @@ -0,0 +1,40 @@ |
| +// 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_REMOTE_COMPOSITOR_BRIDGE_H_ |
| +#define CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "cc/blimp/compositor_proto_state.h" |
| +#include "cc/blimp/remote_compositor_bridge.h" |
| + |
| +namespace cc { |
| + |
| +// An implementation of the RemoteCompositorBridge for tests that pumps |
|
danakj
2016/09/30 22:37:13
tests that pump
Khushal
2016/10/01 00:53:48
Done.
|
| +// BeginMainFrames as soon as the client requests them. |
| +class FakeRemoteCompositorBridge : public RemoteCompositorBridge { |
| + public: |
| + FakeRemoteCompositorBridge( |
| + scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner); |
| + ~FakeRemoteCompositorBridge() override; |
| + |
| + // RemoteCompositorBridge implementation. |
| + void BindToClient(RemoteCompositorBridgeClient* client) override; |
| + void ScheduleMainFrame() override; |
| + void ProcessCompositorStateUpdate( |
| + std::unique_ptr<CompositorProtoState> compositor_proto_state) override {} |
| + |
| + private: |
| + void BeginMainFrame(); |
| + |
| + RemoteCompositorBridgeClient* client_; |
| + base::WeakPtrFactory<FakeRemoteCompositorBridge> weak_factory_; |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_ |