OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TEST_PROXY_MAIN_FOR_TEST_H_ | 5 #ifndef CC_TEST_PROXY_MAIN_FOR_TEST_H_ |
6 #define CC_TEST_PROXY_MAIN_FOR_TEST_H_ | 6 #define CC_TEST_PROXY_MAIN_FOR_TEST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "cc/test/test_hooks.h" | 9 #include "cc/test/test_hooks.h" |
10 #include "cc/trees/proxy_main.h" | 10 #include "cc/trees/proxy_main.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
| 13 class ThreadedChannelForTest; |
13 | 14 |
14 // Creates a ProxyMain that notifies the supplied |test_hooks| of various | 15 // Creates a ProxyMain that notifies the supplied |test_hooks| of various |
15 // actions. | 16 // actions. |
16 class ProxyMainForTest : public ProxyMain { | 17 class ProxyMainForTest : public ProxyMain { |
17 public: | 18 public: |
18 static scoped_ptr<ProxyMain> CreateThreaded( | 19 static scoped_ptr<ProxyMainForTest> CreateThreaded( |
19 TestHooks* test_hooks, | 20 TestHooks* test_hooks, |
20 LayerTreeHost* host, | 21 LayerTreeHost* host, |
21 TaskRunnerProvider* task_runner_provider); | 22 TaskRunnerProvider* task_runner_provider); |
22 | 23 |
| 24 static scoped_ptr<ProxyMainForTest> CreateRemote( |
| 25 TestHooks* test_hooks, |
| 26 RemoteProtoChannel* remote_proto_channel, |
| 27 LayerTreeHost* host, |
| 28 TaskRunnerProvider* task_runner_provider); |
| 29 |
23 ~ProxyMainForTest() override; | 30 ~ProxyMainForTest() override; |
24 | 31 |
25 ProxyMainForTest(TestHooks* test_hooks, | 32 ProxyMainForTest(TestHooks* test_hooks, |
26 LayerTreeHost* host, | 33 LayerTreeHost* host, |
27 TaskRunnerProvider* task_runner_provider); | 34 TaskRunnerProvider* task_runner_provider); |
28 | 35 |
| 36 ThreadedChannelForTest* threaded_channel_for_test() const { |
| 37 return threaded_channel_for_test_; |
| 38 } |
| 39 |
29 void SetNeedsUpdateLayers() override; | 40 void SetNeedsUpdateLayers() override; |
30 void DidCompleteSwapBuffers() override; | 41 void DidCompleteSwapBuffers() override; |
31 void SetRendererCapabilities( | 42 void SetRendererCapabilities( |
32 const RendererCapabilities& capabilities) override; | 43 const RendererCapabilities& capabilities) override; |
33 void BeginMainFrameNotExpectedSoon() override; | 44 void BeginMainFrameNotExpectedSoon() override; |
34 void DidCommitAndDrawFrame() override; | 45 void DidCommitAndDrawFrame() override; |
35 void SetAnimationEvents(scoped_ptr<AnimationEvents> events) override; | 46 void SetAnimationEvents(scoped_ptr<AnimationEvents> events) override; |
36 void DidLoseOutputSurface() override; | 47 void DidLoseOutputSurface() override; |
37 void RequestNewOutputSurface() override; | 48 void RequestNewOutputSurface() override; |
38 void DidInitializeOutputSurface( | 49 void DidInitializeOutputSurface( |
39 bool success, | 50 bool success, |
40 const RendererCapabilities& capabilities) override; | 51 const RendererCapabilities& capabilities) override; |
41 void DidCompletePageScaleAnimation() override; | 52 void DidCompletePageScaleAnimation() override; |
42 void PostFrameTimingEventsOnMain( | 53 void PostFrameTimingEventsOnMain( |
43 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, | 54 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
44 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) | 55 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
45 override; | 56 override; |
46 void BeginMainFrame( | 57 void BeginMainFrame( |
47 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override; | 58 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) override; |
48 | 59 |
49 TestHooks* test_hooks_; | 60 TestHooks* test_hooks_; |
| 61 ThreadedChannelForTest* threaded_channel_for_test_; |
50 }; | 62 }; |
51 | 63 |
52 } // namespace cc | 64 } // namespace cc |
53 | 65 |
54 #endif // CC_TEST_PROXY_MAIN_FOR_TEST_H_ | 66 #endif // CC_TEST_PROXY_MAIN_FOR_TEST_H_ |
OLD | NEW |