blob: 698dbed22566653a52e529c27319d9c3d924dd7b [file] [log] [blame]
// 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 pump
// 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 {}
protected:
void BeginMainFrame();
RemoteCompositorBridgeClient* client_;
base::WeakPtrFactory<FakeRemoteCompositorBridge> weak_factory_;
};
} // namespace cc
#endif // CC_TEST_FAKE_REMOTE_COMPOSITOR_BRIDGE_H_