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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 content::GPUInfo gpu_info_; | 42 content::GPUInfo gpu_info_; |
43 }; | 43 }; |
44 | 44 |
45 TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { | 45 TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { |
46 FilePath data_file; | 46 FilePath data_file; |
47 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); | 47 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); |
48 data_file = | 48 data_file = |
49 data_file.Append(FILE_PATH_LITERAL("chrome")) | 49 data_file.Append(FILE_PATH_LITERAL("chrome")) |
50 .Append(FILE_PATH_LITERAL("browser")) | 50 .Append(FILE_PATH_LITERAL("browser")) |
51 .Append(FILE_PATH_LITERAL("resources")) | 51 .Append(FILE_PATH_LITERAL("resources")) |
| 52 .Append(FILE_PATH_LITERAL("software_rendering_list")) |
52 .Append(FILE_PATH_LITERAL("software_rendering_list.json")); | 53 .Append(FILE_PATH_LITERAL("software_rendering_list.json")); |
53 ASSERT_TRUE(file_util::PathExists(data_file)); | 54 ASSERT_TRUE(file_util::PathExists(data_file)); |
54 int64 data_file_size64 = 0; | 55 int64 data_file_size64 = 0; |
55 ASSERT_TRUE(file_util::GetFileSize(data_file, &data_file_size64)); | 56 ASSERT_TRUE(file_util::GetFileSize(data_file, &data_file_size64)); |
56 int data_file_size = static_cast<int>(data_file_size64); | 57 int data_file_size = static_cast<int>(data_file_size64); |
57 scoped_array<char> data(new char[data_file_size]); | 58 scoped_array<char> data(new char[data_file_size]); |
58 ASSERT_EQ(file_util::ReadFile(data_file, data.get(), data_file_size), | 59 ASSERT_EQ(file_util::ReadFile(data_file, data.get(), data_file_size), |
59 data_file_size); | 60 data_file_size); |
60 std::string json_string(data.get(), data_file_size); | 61 std::string json_string(data.get(), data_file_size); |
61 GpuBlacklist blacklist("1.0 unknown"); | 62 GpuBlacklist blacklist("1.0 unknown"); |
(...skipping 691 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 |