Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: gpu/config/gpu_info_collector_unittest.cc

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Improve Windows initialization and renderBufferMultisample explanation Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_implementation.h"
11 #include "ui/gl/gl_mock.h" 11 #include "ui/gl/gl_mock.h"
12 12
13 using ::gfx::MockGLInterface; 13 using ::gfx::MockGLInterface;
14 using ::testing::Return; 14 using ::testing::Return;
15 15
16 namespace gpu { 16 namespace gpu {
17 17
18 class GPUInfoCollectorTest : public testing::Test { 18 class GPUInfoCollectorTest : public testing::Test {
19 public: 19 public:
20 GPUInfoCollectorTest() {} 20 GPUInfoCollectorTest() {}
21 virtual ~GPUInfoCollectorTest() { } 21 virtual ~GPUInfoCollectorTest() { }
22 22
23 virtual void SetUp() { 23 virtual void SetUp() {
24 // TODO(kbr): make this setup robust in the case where 24 // TODO(kbr): make this setup robust in the case where
25 // GLSurface::InitializeOneOff() has already been called by 25 // GLSurface::InitializeOneOff() has already been called by
26 // another unit test. http://crbug.com/100285 26 // another unit test. http://crbug.com/100285
27 gfx::InitializeGLBindings(gfx::kGLImplementationMockGL); 27 gfx::InitializeStaticGLBindings(gfx::kGLImplementationMockGL);
28 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>()); 28 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
29 ::gfx::GLInterface::SetGLInterface(gl_.get()); 29 ::gfx::GLInterface::SetGLInterface(gl_.get());
30 #if defined(OS_WIN) 30 #if defined(OS_WIN)
31 const uint32 vendor_id = 0x10de; 31 const uint32 vendor_id = 0x10de;
32 const uint32 device_id = 0x0658; 32 const uint32 device_id = 0x0658;
33 const char* driver_vendor = ""; // not implemented 33 const char* driver_vendor = ""; // not implemented
34 const char* driver_version = ""; 34 const char* driver_version = "";
35 const char* shader_version = "1.40"; 35 const char* shader_version = "1.40";
36 const char* gl_version = "3.1"; 36 const char* gl_version = "3.1";
37 const char* gl_renderer = "Quadro FX 380/PCI/SSE2"; 37 const char* gl_renderer = "Quadro FX 380/PCI/SSE2";
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 TEST_F(GPUInfoCollectorTest, DISABLED_GLExtensionsGL) { 178 TEST_F(GPUInfoCollectorTest, DISABLED_GLExtensionsGL) {
179 GPUInfo gpu_info; 179 GPUInfo gpu_info;
180 CollectGraphicsInfoGL(&gpu_info); 180 CollectGraphicsInfoGL(&gpu_info);
181 EXPECT_EQ(test_values_.gl_extensions, 181 EXPECT_EQ(test_values_.gl_extensions,
182 gpu_info.gl_extensions); 182 gpu_info.gl_extensions);
183 } 183 }
184 184
185 } // namespace gpu 185 } // namespace gpu
186 186
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698