OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
8 #include "cc/output/managed_memory_policy.h" | 8 #include "cc/output/managed_memory_policy.h" |
9 #include "cc/output/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
10 #include "cc/output/software_output_device.h" | 10 #include "cc/output/software_output_device.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 TestOutputSurface output_surface_; | 146 TestOutputSurface output_surface_; |
147 FakeOutputSurfaceClient client_; | 147 FakeOutputSurfaceClient client_; |
148 }; | 148 }; |
149 | 149 |
150 TEST_F(OutputSurfaceTestInitializeNewContext3d, Success) { | 150 TEST_F(OutputSurfaceTestInitializeNewContext3d, Success) { |
151 BindOutputSurface(); | 151 BindOutputSurface(); |
152 EXPECT_FALSE(client_.deferred_initialize_called()); | 152 EXPECT_FALSE(client_.deferred_initialize_called()); |
153 | 153 |
154 EXPECT_TRUE(output_surface_.InitializeNewContext3d(context_provider_)); | 154 EXPECT_TRUE(output_surface_.InitializeNewContext3d(context_provider_)); |
155 EXPECT_TRUE(client_.deferred_initialize_called()); | 155 EXPECT_TRUE(client_.deferred_initialize_called()); |
156 EXPECT_EQ(context_provider_, output_surface_.context_provider()); | 156 EXPECT_EQ(context_provider_.get(), output_surface_.context_provider()); |
157 | 157 |
158 EXPECT_FALSE(client_.did_lose_output_surface_called()); | 158 EXPECT_FALSE(client_.did_lose_output_surface_called()); |
159 context_provider_->ContextGL()->LoseContextCHROMIUM( | 159 context_provider_->ContextGL()->LoseContextCHROMIUM( |
160 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB); | 160 GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB); |
161 context_provider_->ContextGL()->Flush(); | 161 context_provider_->ContextGL()->Flush(); |
162 EXPECT_TRUE(client_.did_lose_output_surface_called()); | 162 EXPECT_TRUE(client_.did_lose_output_surface_called()); |
163 | 163 |
164 output_surface_.ReleaseGL(); | 164 output_surface_.ReleaseGL(); |
165 EXPECT_FALSE(output_surface_.context_provider()); | 165 EXPECT_FALSE(output_surface_.context_provider()); |
166 } | 166 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 219 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
220 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); | 220 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); |
221 output_surface.DiscardBackbuffer(); | 221 output_surface.DiscardBackbuffer(); |
222 | 222 |
223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); | 223 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); |
224 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); | 224 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); |
225 } | 225 } |
226 | 226 |
227 } // namespace | 227 } // namespace |
228 } // namespace cc | 228 } // namespace cc |
OLD | NEW |