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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 | 718 |
719 GpuBlacklist blacklist("1.0 unknown"); | 719 GpuBlacklist blacklist("1.0 unknown"); |
720 EXPECT_TRUE( | 720 EXPECT_TRUE( |
721 blacklist.LoadGpuBlacklist(gl_renderer_json, GpuBlacklist::kAllOs)); | 721 blacklist.LoadGpuBlacklist(gl_renderer_json, GpuBlacklist::kAllOs)); |
722 GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags( | 722 GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags( |
723 GpuBlacklist::kOsWin, os_version.get(), gpu_info()); | 723 GpuBlacklist::kOsWin, os_version.get(), gpu_info()); |
724 EXPECT_EQ(flags.flags(), | 724 EXPECT_EQ(flags.flags(), |
725 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); | 725 static_cast<uint32>(GpuFeatureFlags::kGpuFeatureWebgl)); |
726 } | 726 } |
727 | 727 |
| 728 TEST_F(GpuBlacklistTest, DisabledEntry) { |
| 729 const std::string disabled_json = |
| 730 "{\n" |
| 731 " \"name\": \"gpu blacklist\",\n" |
| 732 " \"version\": \"0.1\",\n" |
| 733 " \"entries\": [\n" |
| 734 " {\n" |
| 735 " \"id\": 1,\n" |
| 736 " \"disabled\": true,\n" |
| 737 " \"blacklist\": [\n" |
| 738 " \"webgl\"\n" |
| 739 " ]\n" |
| 740 " }\n" |
| 741 " ]\n" |
| 742 "}"; |
| 743 scoped_ptr<Version> os_version(Version::GetVersionFromString("10.6.4")); |
| 744 |
| 745 GpuBlacklist blacklist("1.0 unknown"); |
| 746 EXPECT_TRUE( |
| 747 blacklist.LoadGpuBlacklist(disabled_json, GpuBlacklist::kAllOs)); |
| 748 GpuFeatureFlags flags = blacklist.DetermineGpuFeatureFlags( |
| 749 GpuBlacklist::kOsWin, os_version.get(), gpu_info()); |
| 750 EXPECT_EQ(flags.flags(), 0u); |
| 751 std::vector<uint32> flag_entries; |
| 752 blacklist.GetGpuFeatureFlagEntries(GpuFeatureFlags::kGpuFeatureAll, |
| 753 flag_entries); |
| 754 EXPECT_EQ(flag_entries.size(), 0u); |
| 755 blacklist.GetGpuFeatureFlagDisabledEntries(GpuFeatureFlags::kGpuFeatureAll, |
| 756 flag_entries); |
| 757 EXPECT_EQ(flag_entries.size(), 1u); |
| 758 } |
| 759 |
OLD | NEW |