Chromium Code Reviews| 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 "gpu/config/gpu_info_collector.h" | |
|
no sievers
2016/04/05 19:02:42
leave below
Mostyn Bramley-Moore
2016/04/05 21:35:32
Fixed.
| |
| 6 | |
| 5 #include <stddef.h> | 7 #include <stddef.h> |
| 6 #include <stdint.h> | 8 #include <stdint.h> |
| 7 | 9 |
| 8 #include "base/memory/scoped_ptr.h" | 10 #include <memory> |
| 11 | |
| 9 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 10 #include "gpu/config/gpu_info.h" | 13 #include "gpu/config/gpu_info.h" |
| 11 #include "gpu/config/gpu_info_collector.h" | |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "ui/gl/gl_implementation.h" | 16 #include "ui/gl/gl_implementation.h" |
| 15 #include "ui/gl/gl_mock.h" | 17 #include "ui/gl/gl_mock.h" |
| 16 #include "ui/gl/test/gl_surface_test_support.h" | 18 #include "ui/gl/test/gl_surface_test_support.h" |
| 17 | 19 |
| 18 using ::gfx::MockGLInterface; | 20 using ::gfx::MockGLInterface; |
| 19 using ::testing::Return; | 21 using ::testing::Return; |
| 20 using ::testing::SetArgPointee; | 22 using ::testing::SetArgPointee; |
| 21 using ::testing::_; | 23 using ::testing::_; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 void TearDown() override { | 168 void TearDown() override { |
| 167 ::gfx::MockGLInterface::SetGLInterface(NULL); | 169 ::gfx::MockGLInterface::SetGLInterface(NULL); |
| 168 gl_.reset(); | 170 gl_.reset(); |
| 169 gfx::ClearGLBindings(); | 171 gfx::ClearGLBindings(); |
| 170 | 172 |
| 171 testing::Test::TearDown(); | 173 testing::Test::TearDown(); |
| 172 } | 174 } |
| 173 | 175 |
| 174 public: | 176 public: |
| 175 // 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. |
| 176 scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; | 178 std::unique_ptr<::testing::StrictMock<::gfx::MockGLInterface>> gl_; |
| 177 GPUInfo test_values_; | 179 GPUInfo test_values_; |
| 178 const char* gl_shading_language_version_ = nullptr; | 180 const char* gl_shading_language_version_ = nullptr; |
| 179 | 181 |
| 180 // Persistent storage is needed for the split extension string. | 182 // Persistent storage is needed for the split extension string. |
| 181 std::vector<std::string> split_extensions_; | 183 std::vector<std::string> split_extensions_; |
| 182 }; | 184 }; |
| 183 | 185 |
| 184 INSTANTIATE_TEST_CASE_P(GPUConfig, | 186 INSTANTIATE_TEST_CASE_P(GPUConfig, |
| 185 GPUInfoCollectorTest, | 187 GPUInfoCollectorTest, |
| 186 ::testing::ValuesIn(kMockedOperatingSystemKinds)); | 188 ::testing::ValuesIn(kMockedOperatingSystemKinds)); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 | 354 |
| 353 gpu_info.gl_vendor = "Google Corporation"; | 355 gpu_info.gl_vendor = "Google Corporation"; |
| 354 gpu_info.gl_renderer = "Chrome GPU Team"; | 356 gpu_info.gl_renderer = "Chrome GPU Team"; |
| 355 IdentifyActiveGPU(&gpu_info); | 357 IdentifyActiveGPU(&gpu_info); |
| 356 EXPECT_FALSE(gpu_info.gpu.active); | 358 EXPECT_FALSE(gpu_info.gpu.active); |
| 357 EXPECT_FALSE(gpu_info.secondary_gpus[0].active); | 359 EXPECT_FALSE(gpu_info.secondary_gpus[0].active); |
| 358 } | 360 } |
| 359 | 361 |
| 360 } // namespace gpu | 362 } // namespace gpu |
| 361 | 363 |
| OLD | NEW |