| OLD | NEW |
| 1 // Copyright (c) 2011 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 "content/gpu/gpu_idirect3d9_mock_win.h" | 6 #include "content/gpu/gpu_idirect3d9_mock_win.h" |
| 7 #include "content/gpu/gpu_info_collector.h" | 7 #include "content/gpu/gpu_info_collector.h" |
| 8 #include "content/public/common/gpu_info.h" | 8 #include "content/public/common/gpu_info.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 25 test_identifier_.DeviceId = 0x429; | 25 test_identifier_.DeviceId = 0x429; |
| 26 test_identifier_.DriverVersion.QuadPart = 0x6000e000b1e23; // 6.14.11.7715 | 26 test_identifier_.DriverVersion.QuadPart = 0x6000e000b1e23; // 6.14.11.7715 |
| 27 test_caps_.PixelShaderVersion = 0xffff0300; // 3.0 | 27 test_caps_.PixelShaderVersion = 0xffff0300; // 3.0 |
| 28 test_caps_.VertexShaderVersion = 0xfffe0300; // 3.0 | 28 test_caps_.VertexShaderVersion = 0xfffe0300; // 3.0 |
| 29 | 29 |
| 30 EXPECT_CALL(d3d_, GetDeviceCaps(_, _, _)) | 30 EXPECT_CALL(d3d_, GetDeviceCaps(_, _, _)) |
| 31 .WillOnce(DoAll(SetArgumentPointee<2>(test_caps_), | 31 .WillOnce(DoAll(SetArgumentPointee<2>(test_caps_), |
| 32 Return(D3D_OK))); | 32 Return(D3D_OK))); |
| 33 EXPECT_CALL(d3d_, QueryInterface(__uuidof(IDirect3D9Ex), _)) | 33 EXPECT_CALL(d3d_, QueryInterface(__uuidof(IDirect3D9Ex), _)) |
| 34 .WillOnce(Return(E_NOINTERFACE)); | 34 .WillOnce(Return(E_NOINTERFACE)); |
| 35 EXPECT_CALL(d3d_, Release()); | |
| 36 } | 35 } |
| 37 void TearDown() { | 36 void TearDown() { |
| 38 } | 37 } |
| 39 | 38 |
| 40 public: | 39 public: |
| 41 IDirect3D9Mock d3d_; | 40 IDirect3D9Mock d3d_; |
| 42 private: | 41 private: |
| 43 D3DADAPTER_IDENTIFIER9 test_identifier_; | 42 D3DADAPTER_IDENTIFIER9 test_identifier_; |
| 44 D3DCAPS9 test_caps_; | 43 D3DCAPS9 test_caps_; |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 TEST_F(GPUInfoTest, PixelShaderVersionD3D) { | 46 TEST_F(GPUInfoTest, PixelShaderVersionD3D) { |
| 48 content::GPUInfo gpu_info; | 47 content::GPUInfo gpu_info; |
| 49 ASSERT_TRUE(gpu_info_collector::CollectGraphicsInfoD3D(&d3d_, &gpu_info)); | 48 ASSERT_TRUE(gpu_info_collector::CollectGraphicsInfoD3D(&d3d_, &gpu_info)); |
| 50 EXPECT_EQ(gpu_info.pixel_shader_version, "3.0"); | 49 EXPECT_EQ(gpu_info.pixel_shader_version, "3.0"); |
| 51 } | 50 } |
| 52 | 51 |
| 53 TEST_F(GPUInfoTest, VertexShaderVersionD3D) { | 52 TEST_F(GPUInfoTest, VertexShaderVersionD3D) { |
| 54 content::GPUInfo gpu_info; | 53 content::GPUInfo gpu_info; |
| 55 ASSERT_TRUE(gpu_info_collector::CollectGraphicsInfoD3D(&d3d_, &gpu_info)); | 54 ASSERT_TRUE(gpu_info_collector::CollectGraphicsInfoD3D(&d3d_, &gpu_info)); |
| 56 EXPECT_EQ(gpu_info.vertex_shader_version, "3.0"); | 55 EXPECT_EQ(gpu_info.vertex_shader_version, "3.0"); |
| 57 } | 56 } |
| OLD | NEW |