| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 EXPECT_EQ(flags.flags(), | 182 EXPECT_EQ(flags.flags(), |
| 183 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); | 183 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); |
| 184 flags = blacklist.DetermineGpuFeatureFlags( | 184 flags = blacklist.DetermineGpuFeatureFlags( |
| 185 GpuBlacklist::kOsWin, os_version.get(), gpu_info()); | 185 GpuBlacklist::kOsWin, os_version.get(), gpu_info()); |
| 186 EXPECT_EQ(flags.flags(), | 186 EXPECT_EQ(flags.flags(), |
| 187 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); | 187 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); |
| 188 flags = blacklist.DetermineGpuFeatureFlags( | 188 flags = blacklist.DetermineGpuFeatureFlags( |
| 189 GpuBlacklist::kOsLinux, os_version.get(), gpu_info()); | 189 GpuBlacklist::kOsLinux, os_version.get(), gpu_info()); |
| 190 EXPECT_EQ(flags.flags(), | 190 EXPECT_EQ(flags.flags(), |
| 191 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); | 191 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); |
| 192 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) | 192 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) || \ |
| 193 defined(OS_OPENBSD) |
| 193 // Blacklist entries will be filtered to the current OS only upon loading. | 194 // Blacklist entries will be filtered to the current OS only upon loading. |
| 194 EXPECT_TRUE( | 195 EXPECT_TRUE( |
| 195 blacklist.LoadGpuBlacklist(vendor_json, GpuBlacklist::kCurrentOsOnly)); | 196 blacklist.LoadGpuBlacklist(vendor_json, GpuBlacklist::kCurrentOsOnly)); |
| 196 flags = blacklist.DetermineGpuFeatureFlags( | 197 flags = blacklist.DetermineGpuFeatureFlags( |
| 197 GpuBlacklist::kOsMacosx, os_version.get(), gpu_info()); | 198 GpuBlacklist::kOsMacosx, os_version.get(), gpu_info()); |
| 198 EXPECT_EQ(flags.flags(), | 199 EXPECT_EQ(flags.flags(), |
| 199 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); | 200 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); |
| 200 flags = blacklist.DetermineGpuFeatureFlags( | 201 flags = blacklist.DetermineGpuFeatureFlags( |
| 201 GpuBlacklist::kOsWin, os_version.get(), gpu_info()); | 202 GpuBlacklist::kOsWin, os_version.get(), gpu_info()); |
| 202 EXPECT_EQ(flags.flags(), | 203 EXPECT_EQ(flags.flags(), |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 bool disabled = false; | 754 bool disabled = false; |
| 754 blacklist.GetGpuFeatureFlagEntries( | 755 blacklist.GetGpuFeatureFlagEntries( |
| 755 GpuFeatureFlags::kGpuFeatureAll, flag_entries, disabled); | 756 GpuFeatureFlags::kGpuFeatureAll, flag_entries, disabled); |
| 756 EXPECT_EQ(flag_entries.size(), 0u); | 757 EXPECT_EQ(flag_entries.size(), 0u); |
| 757 disabled = true; | 758 disabled = true; |
| 758 blacklist.GetGpuFeatureFlagEntries( | 759 blacklist.GetGpuFeatureFlagEntries( |
| 759 GpuFeatureFlags::kGpuFeatureAll, flag_entries, disabled); | 760 GpuFeatureFlags::kGpuFeatureAll, flag_entries, disabled); |
| 760 EXPECT_EQ(flag_entries.size(), 1u); | 761 EXPECT_EQ(flag_entries.size(), 1u); |
| 761 } | 762 } |
| 762 | 763 |
| OLD | NEW |