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

Side by Side Diff: chrome/gpu/gpu_info_unittest_win.cc

Issue 6684015: Move chrome\gpu to content\gpu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/gpu/gpu_info_collector_win.cc ('k') | chrome/gpu/gpu_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/scoped_ptr.h"
6 #include "chrome/gpu/gpu_idirect3d9_mock_win.h"
7 #include "chrome/gpu/gpu_info_collector.h"
8 #include "content/common/gpu_info.h"
9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 using ::testing::_;
13 using ::testing::Return;
14 using ::testing::SetArgumentPointee;
15
16 class GPUInfoTest : public testing::Test {
17 public:
18 GPUInfoTest() { }
19 virtual ~GPUInfoTest() { }
20
21 protected:
22 void SetUp() {
23 // Test variables taken from Lenovo T61
24 test_identifier_.VendorId = 0x10de;
25 test_identifier_.DeviceId = 0x429;
26 test_identifier_.DriverVersion.QuadPart = 0x6000e000b1e23; // 6.14.11.7715
27 test_caps_.PixelShaderVersion = 0xffff0300; // 3.0
28 test_caps_.VertexShaderVersion = 0xfffe0300; // 3.0
29
30 EXPECT_CALL(d3d_, GetDeviceCaps(_, _, _))
31 .WillOnce(DoAll(SetArgumentPointee<2>(test_caps_),
32 Return(D3D_OK)));
33 EXPECT_CALL(d3d_, QueryInterface(__uuidof(IDirect3D9Ex), _))
34 .WillOnce(Return(E_NOINTERFACE));
35 EXPECT_CALL(d3d_, Release());
36 }
37 void TearDown() {
38 }
39
40 public:
41 IDirect3D9Mock d3d_;
42 private:
43 D3DADAPTER_IDENTIFIER9 test_identifier_;
44 D3DCAPS9 test_caps_;
45 };
46
47 TEST_F(GPUInfoTest, PixelShaderVersionD3D) {
48 GPUInfo gpu_info;
49 ASSERT_TRUE(gpu_info_collector::CollectGraphicsInfoD3D(&d3d_, &gpu_info));
50 uint32 ps_version = gpu_info.pixel_shader_version;
51 EXPECT_EQ(ps_version, D3DPS_VERSION(3, 0));
52 }
53
54 TEST_F(GPUInfoTest, VertexShaderVersionD3D) {
55 GPUInfo gpu_info;
56 ASSERT_TRUE(gpu_info_collector::CollectGraphicsInfoD3D(&d3d_, &gpu_info));
57 uint32 vs_version = gpu_info.vertex_shader_version;
58 EXPECT_EQ(vs_version, D3DVS_VERSION(3, 0));
59 }
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_info_collector_win.cc ('k') | chrome/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698