| 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> |
| 6 #include <stdint.h> |
| 7 |
| 5 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 7 #include "gpu/config/gpu_info.h" | 10 #include "gpu/config/gpu_info.h" |
| 8 #include "gpu/config/gpu_info_collector.h" | 11 #include "gpu/config/gpu_info_collector.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 12 #include "ui/gl/gl_mock.h" | 15 #include "ui/gl/gl_mock.h" |
| 13 #include "ui/gl/test/gl_surface_test_support.h" | 16 #include "ui/gl/test/gl_surface_test_support.h" |
| 14 | 17 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 test_values_.gl_extensions.c_str()))); | 138 test_values_.gl_extensions.c_str()))); |
| 136 } else { | 139 } else { |
| 137 split_extensions_.clear(); | 140 split_extensions_.clear(); |
| 138 split_extensions_ = base::SplitString( | 141 split_extensions_ = base::SplitString( |
| 139 test_values_.gl_extensions, " ", | 142 test_values_.gl_extensions, " ", |
| 140 base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | 143 base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
| 141 EXPECT_CALL(*gl_, GetIntegerv(GL_NUM_EXTENSIONS, _)) | 144 EXPECT_CALL(*gl_, GetIntegerv(GL_NUM_EXTENSIONS, _)) |
| 142 .WillRepeatedly(SetArgPointee<1>(split_extensions_.size())); | 145 .WillRepeatedly(SetArgPointee<1>(split_extensions_.size())); |
| 143 for (size_t ii = 0; ii < split_extensions_.size(); ++ii) { | 146 for (size_t ii = 0; ii < split_extensions_.size(); ++ii) { |
| 144 EXPECT_CALL(*gl_, GetStringi(GL_EXTENSIONS, ii)) | 147 EXPECT_CALL(*gl_, GetStringi(GL_EXTENSIONS, ii)) |
| 145 .WillRepeatedly(Return(reinterpret_cast<const uint8*>( | 148 .WillRepeatedly(Return(reinterpret_cast<const uint8_t*>( |
| 146 split_extensions_[ii].c_str()))); | 149 split_extensions_[ii].c_str()))); |
| 147 } | 150 } |
| 148 } | 151 } |
| 149 EXPECT_CALL(*gl_, GetString(GL_SHADING_LANGUAGE_VERSION)) | 152 EXPECT_CALL(*gl_, GetString(GL_SHADING_LANGUAGE_VERSION)) |
| 150 .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>( | 153 .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>( |
| 151 gl_shading_language_version_))); | 154 gl_shading_language_version_))); |
| 152 EXPECT_CALL(*gl_, GetString(GL_VENDOR)) | 155 EXPECT_CALL(*gl_, GetString(GL_VENDOR)) |
| 153 .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>( | 156 .WillRepeatedly(Return(reinterpret_cast<const GLubyte*>( |
| 154 test_values_.gl_vendor.c_str()))); | 157 test_values_.gl_vendor.c_str()))); |
| 155 EXPECT_CALL(*gl_, GetString(GL_RENDERER)) | 158 EXPECT_CALL(*gl_, GetString(GL_RENDERER)) |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 352 |
| 350 gpu_info.gl_vendor = "Google Corporation"; | 353 gpu_info.gl_vendor = "Google Corporation"; |
| 351 gpu_info.gl_renderer = "Chrome GPU Team"; | 354 gpu_info.gl_renderer = "Chrome GPU Team"; |
| 352 IdentifyActiveGPU(&gpu_info); | 355 IdentifyActiveGPU(&gpu_info); |
| 353 EXPECT_FALSE(gpu_info.gpu.active); | 356 EXPECT_FALSE(gpu_info.gpu.active); |
| 354 EXPECT_FALSE(gpu_info.secondary_gpus[0].active); | 357 EXPECT_FALSE(gpu_info.secondary_gpus[0].active); |
| 355 } | 358 } |
| 356 | 359 |
| 357 } // namespace gpu | 360 } // namespace gpu |
| 358 | 361 |
| OLD | NEW |