| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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/version.h" | 5 #include "base/version.h" |
| 6 #include "chrome/browser/gpu_blacklist.h" | 6 #include "chrome/browser/gpu_blacklist.h" |
| 7 #include "chrome/common/gpu_info.h" | 7 #include "chrome/common/gpu_info.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 TEST(GpuBlacklistTest, BlacklistLogic) { | 10 TEST(GpuBlacklistTest, BlacklistLogic) { |
| 11 GPUInfo gpu_info; | 11 GPUInfo gpu_info; |
| 12 gpu_info.SetGraphicsInfo(0x10de, // Vendor ID | 12 gpu_info.SetVideoCardInfo(0x10de, // Vendor ID |
| 13 0x0640, // Device ID | 13 0x0640); // Device ID |
| 14 L"1.6.18", // Driver Version | 14 gpu_info.SetDriverInfo("NVIDIA", // Driver vendor |
| 15 0x0114, // Pixel Shader Version | 15 "1.6.18"); // Driver Version |
| 16 0x0114, // Vertex Shader Version | |
| 17 0x0201, // GL version, | |
| 18 true); // can_lose_context | |
| 19 gpu_info.SetProgress(GPUInfo::kComplete); | 16 gpu_info.SetProgress(GPUInfo::kComplete); |
| 20 scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4")); | 17 scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4")); |
| 21 | 18 |
| 22 GpuBlacklist blacklist; | 19 GpuBlacklist blacklist; |
| 23 | 20 |
| 24 // Default blacklist settings: all feature are allowed. | 21 // Default blacklist settings: all feature are allowed. |
| 25 GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags( | 22 GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags( |
| 26 GpuBlacklist::kOsMacosx, os_version.get(), gpu_info); | 23 GpuBlacklist::kOsMacosx, os_version.get(), gpu_info); |
| 27 EXPECT_EQ(flags.flags(), 0u); | 24 EXPECT_EQ(flags.flags(), 0u); |
| 28 | 25 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 flags = blacklist.DetermineGpuFeatureFlags( | 130 flags = blacklist.DetermineGpuFeatureFlags( |
| 134 GpuBlacklist::kOsWin, os_version.get(), gpu_info); | 131 GpuBlacklist::kOsWin, os_version.get(), gpu_info); |
| 135 EXPECT_EQ(flags.flags(), 0u); | 132 EXPECT_EQ(flags.flags(), 0u); |
| 136 flags = blacklist.DetermineGpuFeatureFlags( | 133 flags = blacklist.DetermineGpuFeatureFlags( |
| 137 GpuBlacklist::kOsLinux, os_version.get(), gpu_info); | 134 GpuBlacklist::kOsLinux, os_version.get(), gpu_info); |
| 138 EXPECT_EQ( | 135 EXPECT_EQ( |
| 139 flags.flags(), | 136 flags.flags(), |
| 140 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); | 137 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); |
| 141 } | 138 } |
| 142 | 139 |
| OLD | NEW |