OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "cc/test/layer_tree_test.h" | 7 #include "cc/test/layer_tree_test.h" |
8 #include "cc/trees/thread_proxy.h" | 8 #include "cc/trees/thread_proxy.h" |
9 | 9 |
10 #define THREAD_PROXY_NO_IMPL_TEST_F(TEST_FIXTURE_NAME) \ | 10 #define THREAD_PROXY_NO_IMPL_TEST_F(TEST_FIXTURE_NAME) \ |
(...skipping 19 matching lines...) Expand all Loading... |
30 ProxyTest() {} | 30 ProxyTest() {} |
31 virtual ~ProxyTest() {} | 31 virtual ~ProxyTest() {} |
32 | 32 |
33 void Run(bool threaded, bool impl_side_painting) { | 33 void Run(bool threaded, bool impl_side_painting) { |
34 // We don't need to care about delegating mode. | 34 // We don't need to care about delegating mode. |
35 bool delegating_renderer = true; | 35 bool delegating_renderer = true; |
36 | 36 |
37 RunTest(threaded, delegating_renderer, impl_side_painting); | 37 RunTest(threaded, delegating_renderer, impl_side_painting); |
38 } | 38 } |
39 | 39 |
40 virtual void BeginTest() OVERRIDE {} | 40 virtual void BeginTest() override {} |
41 virtual void AfterTest() OVERRIDE {} | 41 virtual void AfterTest() override {} |
42 | 42 |
43 private: | 43 private: |
44 DISALLOW_COPY_AND_ASSIGN(ProxyTest); | 44 DISALLOW_COPY_AND_ASSIGN(ProxyTest); |
45 }; | 45 }; |
46 | 46 |
47 class ProxyTestScheduledActionsBasic : public ProxyTest { | 47 class ProxyTestScheduledActionsBasic : public ProxyTest { |
48 protected: | 48 protected: |
49 virtual void BeginTest() OVERRIDE { | 49 virtual void BeginTest() override { |
50 proxy()->SetNeedsCommit(); | 50 proxy()->SetNeedsCommit(); |
51 } | 51 } |
52 | 52 |
53 virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE { | 53 virtual void ScheduledActionBeginOutputSurfaceCreation() override { |
54 EXPECT_EQ(0, action_phase_++); | 54 EXPECT_EQ(0, action_phase_++); |
55 } | 55 } |
56 | 56 |
57 virtual void ScheduledActionSendBeginMainFrame() OVERRIDE { | 57 virtual void ScheduledActionSendBeginMainFrame() override { |
58 EXPECT_EQ(1, action_phase_++); | 58 EXPECT_EQ(1, action_phase_++); |
59 } | 59 } |
60 | 60 |
61 virtual void ScheduledActionCommit() OVERRIDE { | 61 virtual void ScheduledActionCommit() override { |
62 EXPECT_EQ(2, action_phase_++); | 62 EXPECT_EQ(2, action_phase_++); |
63 } | 63 } |
64 | 64 |
65 virtual void ScheduledActionDrawAndSwapIfPossible() OVERRIDE { | 65 virtual void ScheduledActionDrawAndSwapIfPossible() override { |
66 EXPECT_EQ(3, action_phase_++); | 66 EXPECT_EQ(3, action_phase_++); |
67 EndTest(); | 67 EndTest(); |
68 } | 68 } |
69 | 69 |
70 virtual void AfterTest() OVERRIDE { | 70 virtual void AfterTest() override { |
71 EXPECT_EQ(4, action_phase_); | 71 EXPECT_EQ(4, action_phase_); |
72 } | 72 } |
73 | 73 |
74 ProxyTestScheduledActionsBasic() : action_phase_(0) { | 74 ProxyTestScheduledActionsBasic() : action_phase_(0) { |
75 } | 75 } |
76 virtual ~ProxyTestScheduledActionsBasic() {} | 76 virtual ~ProxyTestScheduledActionsBasic() {} |
77 | 77 |
78 private: | 78 private: |
79 int action_phase_; | 79 int action_phase_; |
80 | 80 |
(...skipping 21 matching lines...) Expand all Loading... |
102 | 102 |
103 private: | 103 private: |
104 DISALLOW_COPY_AND_ASSIGN(ThreadProxyTest); | 104 DISALLOW_COPY_AND_ASSIGN(ThreadProxyTest); |
105 }; | 105 }; |
106 | 106 |
107 class ThreadProxyTestSetNeedsCommit : public ThreadProxyTest { | 107 class ThreadProxyTestSetNeedsCommit : public ThreadProxyTest { |
108 protected: | 108 protected: |
109 ThreadProxyTestSetNeedsCommit() {} | 109 ThreadProxyTestSetNeedsCommit() {} |
110 virtual ~ThreadProxyTestSetNeedsCommit() {} | 110 virtual ~ThreadProxyTestSetNeedsCommit() {} |
111 | 111 |
112 virtual void BeginTest() OVERRIDE { | 112 virtual void BeginTest() override { |
113 EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); | 113 EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); |
114 EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); | 114 EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); |
115 | 115 |
116 proxy()->SetNeedsCommit(); | 116 proxy()->SetNeedsCommit(); |
117 | 117 |
118 EXPECT_TRUE(ThreadProxyMainOnly().commit_requested); | 118 EXPECT_TRUE(ThreadProxyMainOnly().commit_requested); |
119 EXPECT_TRUE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); | 119 EXPECT_TRUE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); |
120 } | 120 } |
121 | 121 |
122 virtual void DidBeginMainFrame() OVERRIDE { | 122 virtual void DidBeginMainFrame() override { |
123 EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); | 123 EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); |
124 EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); | 124 EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); |
125 | 125 |
126 EndTest(); | 126 EndTest(); |
127 } | 127 } |
128 | 128 |
129 private: | 129 private: |
130 DISALLOW_COPY_AND_ASSIGN(ThreadProxyTestSetNeedsCommit); | 130 DISALLOW_COPY_AND_ASSIGN(ThreadProxyTestSetNeedsCommit); |
131 }; | 131 }; |
132 | 132 |
133 THREAD_PROXY_TEST_F(ThreadProxyTestSetNeedsCommit); | 133 THREAD_PROXY_TEST_F(ThreadProxyTestSetNeedsCommit); |
134 | 134 |
135 } // namespace cc | 135 } // namespace cc |
OLD | NEW |