summaryrefslogtreecommitdiffstats
path: root/cc/test/threaded_channel_for_test.h
blob: 6a47d10cfb990567f9c3ff1101d7001e703ae61b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2011 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_THREADED_CHANNEL_FOR_TEST_H_
#define CC_TEST_THREADED_CHANNEL_FOR_TEST_H_

#include "base/macros.h"
#include "cc/test/test_hooks.h"
#include "cc/trees/threaded_channel.h"

namespace cc {
class ProxyImplForTest;

// ThreadedChannel that notifies |test_hooks| of internal actions by ProxyImpl.
class ThreadedChannelForTest : public ThreadedChannel {
 public:
  static scoped_ptr<ThreadedChannelForTest> Create(
      TestHooks* test_hooks,
      ProxyMain* proxy_main,
      TaskRunnerProvider* task_runner_provider);

  ProxyImplForTest* proxy_impl_for_test() { return proxy_impl_for_test_; }

 private:
  ThreadedChannelForTest(TestHooks* test_hooks,
                         ProxyMain* proxy_main,
                         TaskRunnerProvider* task_runner_provider);

  scoped_ptr<ProxyImpl> CreateProxyImpl(
      ChannelImpl* channel_impl,
      LayerTreeHost* layer_tree_host,
      TaskRunnerProvider* task_runner_provider,
      scoped_ptr<BeginFrameSource> external_begin_frame_source) override;

  TestHooks* test_hooks_;
  ProxyImplForTest* proxy_impl_for_test_;
};

}  // namespace cc

#endif  // CC_TEST_THREADED_CHANNEL_FOR_TEST_H_