| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "gpu/config/gpu_info.h" | 6 #include "gpu/config/gpu_info.h" |
| 7 #include "gpu/config/gpu_info_collector.h" | 7 #include "gpu/config/gpu_info_collector.h" |
| 8 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/gl/gl_implementation.h" |
| 10 #include "ui/gl/gl_mock.h" | 11 #include "ui/gl/gl_mock.h" |
| 11 | 12 |
| 12 using ::gfx::MockGLInterface; | 13 using ::gfx::MockGLInterface; |
| 13 using ::testing::Return; | 14 using ::testing::Return; |
| 14 | 15 |
| 15 namespace gpu { | 16 namespace gpu { |
| 16 | 17 |
| 17 class GPUInfoCollectorTest : public testing::Test { | 18 class GPUInfoCollectorTest : public testing::Test { |
| 18 public: | 19 public: |
| 19 GPUInfoCollectorTest() {} | 20 GPUInfoCollectorTest() {} |
| 20 virtual ~GPUInfoCollectorTest() { } | 21 virtual ~GPUInfoCollectorTest() { } |
| 21 | 22 |
| 22 virtual void SetUp() { | 23 virtual void SetUp() { |
| 24 // TODO(kbr): make this setup robust in the case where |
| 25 // GLSurface::InitializeOneOff() has already been called by |
| 26 // another unit test. http://crbug.com/100285 |
| 27 gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress); |
| 28 gfx::InitializeStaticGLBindings(gfx::kGLImplementationMockGL); |
| 23 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); | 29 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); |
| 24 ::gfx::MockGLInterface::SetGLInterface(gl_.get()); | 30 ::gfx::MockGLInterface::SetGLInterface(gl_.get()); |
| 25 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 26 const uint32 vendor_id = 0x10de; | 32 const uint32 vendor_id = 0x10de; |
| 27 const uint32 device_id = 0x0658; | 33 const uint32 device_id = 0x0658; |
| 28 const char* driver_vendor = ""; // not implemented | 34 const char* driver_vendor = ""; // not implemented |
| 29 const char* driver_version = ""; | 35 const char* driver_version = ""; |
| 30 const char* shader_version = "1.40"; | 36 const char* shader_version = "1.40"; |
| 31 const char* gl_version = "3.1"; | 37 const char* gl_version = "3.1"; |
| 32 const char* gl_renderer = "Quadro FX 380/PCI/SSE2"; | 38 const char* gl_renderer = "Quadro FX 380/PCI/SSE2"; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 178 |
| 173 TEST_F(GPUInfoCollectorTest, DISABLED_GLExtensionsGL) { | 179 TEST_F(GPUInfoCollectorTest, DISABLED_GLExtensionsGL) { |
| 174 GPUInfo gpu_info; | 180 GPUInfo gpu_info; |
| 175 CollectGraphicsInfoGL(&gpu_info); | 181 CollectGraphicsInfoGL(&gpu_info); |
| 176 EXPECT_EQ(test_values_.gl_extensions, | 182 EXPECT_EQ(test_values_.gl_extensions, |
| 177 gpu_info.gl_extensions); | 183 gpu_info.gl_extensions); |
| 178 } | 184 } |
| 179 | 185 |
| 180 } // namespace gpu | 186 } // namespace gpu |
| 181 | 187 |
| OLD | NEW |