OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
11 #include "gpu/config/gpu_info.h" | 11 #include "gpu/config/gpu_info.h" |
12 #include "gpu/config/gpu_info_collector.h" | 12 #include "gpu/config/gpu_info_collector.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "ui/gl/gl_implementation.h" | 15 #include "ui/gl/gl_implementation.h" |
16 #include "ui/gl/gl_mock.h" | 16 #include "ui/gl/gl_mock.h" |
| 17 #include "ui/gl/init/gl_factory.h" |
17 #include "ui/gl/test/gl_surface_test_support.h" | 18 #include "ui/gl/test/gl_surface_test_support.h" |
18 | 19 |
19 using ::gl::MockGLInterface; | 20 using ::gl::MockGLInterface; |
20 using ::testing::Return; | 21 using ::testing::Return; |
21 using ::testing::SetArgPointee; | 22 using ::testing::SetArgPointee; |
22 using ::testing::_; | 23 using ::testing::_; |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 // Allows testing of all configurations on all operating systems. | 27 // Allows testing of all configurations on all operating systems. |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>( | 161 .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>( |
161 test_values_.gl_renderer.c_str()))); | 162 test_values_.gl_renderer.c_str()))); |
162 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_SAMPLES, _)) | 163 EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_SAMPLES, _)) |
163 .WillOnce(SetArgPointee<1>(8)) | 164 .WillOnce(SetArgPointee<1>(8)) |
164 .RetiresOnSaturation(); | 165 .RetiresOnSaturation(); |
165 } | 166 } |
166 | 167 |
167 void TearDown() override { | 168 void TearDown() override { |
168 ::gl::MockGLInterface::SetGLInterface(NULL); | 169 ::gl::MockGLInterface::SetGLInterface(NULL); |
169 gl_.reset(); | 170 gl_.reset(); |
170 gl::ClearGLBindings(); | 171 gl::init::ClearGLBindings(); |
171 | 172 |
172 testing::Test::TearDown(); | 173 testing::Test::TearDown(); |
173 } | 174 } |
174 | 175 |
175 public: | 176 public: |
176 // Use StrictMock to make 100% sure we know how GL will be called. | 177 // Use StrictMock to make 100% sure we know how GL will be called. |
177 std::unique_ptr<::testing::StrictMock<::gl::MockGLInterface>> gl_; | 178 std::unique_ptr<::testing::StrictMock<::gl::MockGLInterface>> gl_; |
178 GPUInfo test_values_; | 179 GPUInfo test_values_; |
179 const char* gl_shading_language_version_ = nullptr; | 180 const char* gl_shading_language_version_ = nullptr; |
180 | 181 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 354 |
354 gpu_info.gl_vendor = "Google Corporation"; | 355 gpu_info.gl_vendor = "Google Corporation"; |
355 gpu_info.gl_renderer = "Chrome GPU Team"; | 356 gpu_info.gl_renderer = "Chrome GPU Team"; |
356 IdentifyActiveGPU(&gpu_info); | 357 IdentifyActiveGPU(&gpu_info); |
357 EXPECT_FALSE(gpu_info.gpu.active); | 358 EXPECT_FALSE(gpu_info.gpu.active); |
358 EXPECT_FALSE(gpu_info.secondary_gpus[0].active); | 359 EXPECT_FALSE(gpu_info.secondary_gpus[0].active); |
359 } | 360 } |
360 | 361 |
361 } // namespace gpu | 362 } // namespace gpu |
362 | 363 |
OLD | NEW |