| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/version.h" | 7 #include "base/version.h" |
| 8 #include "chrome/browser/gpu_blacklist.h" | 8 #include "chrome/browser/gpu_blacklist.h" |
| 9 #include "chrome/common/gpu_info.h" | 9 #include "chrome/common/gpu_info.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 TEST(GpuBlacklistTest, BlacklistLogic) { | 12 TEST(GpuBlacklistTest, BlacklistLogic) { |
| 13 GPUInfo gpu_info; | 13 GPUInfo gpu_info; |
| 14 gpu_info.SetVideoCardInfo(0x10de, // Vendor ID | 14 gpu_info.SetVideoCardInfo(0x10de, // Vendor ID |
| 15 0x0640); // Device ID | 15 0x0640); // Device ID |
| 16 gpu_info.SetDriverInfo("NVIDIA", // Driver vendor | 16 gpu_info.SetDriverInfo("NVIDIA", // Driver vendor |
| 17 "1.6.18"); // Driver Version | 17 "1.6.18"); // Driver Version |
| 18 gpu_info.SetProgress(GPUInfo::kComplete); | 18 gpu_info.SetLevel(GPUInfo::kComplete); |
| 19 scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4")); | 19 scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4")); |
| 20 | 20 |
| 21 GpuBlacklist blacklist; | 21 GpuBlacklist blacklist; |
| 22 | 22 |
| 23 // Default blacklist settings: all feature are allowed. | 23 // Default blacklist settings: all feature are allowed. |
| 24 GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags( | 24 GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags( |
| 25 GpuBlacklist::kOsMacosx, os_version.get(), gpu_info); | 25 GpuBlacklist::kOsMacosx, os_version.get(), gpu_info); |
| 26 EXPECT_EQ(flags.flags(), 0u); | 26 EXPECT_EQ(flags.flags(), 0u); |
| 27 | 27 |
| 28 // Empty list: all features are allowed. | 28 // Empty list: all features are allowed. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 flags = blacklist.DetermineGpuFeatureFlags( | 149 flags = blacklist.DetermineGpuFeatureFlags( |
| 150 GpuBlacklist::kOsWin, os_version.get(), gpu_info); | 150 GpuBlacklist::kOsWin, os_version.get(), gpu_info); |
| 151 EXPECT_EQ(flags.flags(), 0u); | 151 EXPECT_EQ(flags.flags(), 0u); |
| 152 flags = blacklist.DetermineGpuFeatureFlags( | 152 flags = blacklist.DetermineGpuFeatureFlags( |
| 153 GpuBlacklist::kOsLinux, os_version.get(), gpu_info); | 153 GpuBlacklist::kOsLinux, os_version.get(), gpu_info); |
| 154 EXPECT_EQ( | 154 EXPECT_EQ( |
| 155 flags.flags(), | 155 flags.flags(), |
| 156 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); | 156 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureAccelerated2dCanvas)); |
| 157 } | 157 } |
| 158 | 158 |
| OLD | NEW |