OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 private: | 51 private: |
52 content::GPUInfo gpu_info_; | 52 content::GPUInfo gpu_info_; |
53 }; | 53 }; |
54 | 54 |
55 TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { | 55 TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { |
56 FilePath data_file; | 56 FilePath data_file; |
57 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); | 57 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); |
58 data_file = | 58 data_file = |
59 data_file.Append(FILE_PATH_LITERAL("chrome")) | 59 data_file.Append(FILE_PATH_LITERAL("content")) |
60 .Append(FILE_PATH_LITERAL("browser")) | 60 .Append(FILE_PATH_LITERAL("browser")) |
61 .Append(FILE_PATH_LITERAL("resources")) | 61 .Append(FILE_PATH_LITERAL("gpu")) |
62 .Append(FILE_PATH_LITERAL("software_rendering_list.json")); | 62 .Append(FILE_PATH_LITERAL("software_rendering_list.json")); |
63 ASSERT_TRUE(file_util::PathExists(data_file)); | 63 ASSERT_TRUE(file_util::PathExists(data_file)); |
64 int64 data_file_size64 = 0; | 64 int64 data_file_size64 = 0; |
65 ASSERT_TRUE(file_util::GetFileSize(data_file, &data_file_size64)); | 65 ASSERT_TRUE(file_util::GetFileSize(data_file, &data_file_size64)); |
66 int data_file_size = static_cast<int>(data_file_size64); | 66 int data_file_size = static_cast<int>(data_file_size64); |
67 scoped_array<char> data(new char[data_file_size]); | 67 scoped_array<char> data(new char[data_file_size]); |
68 ASSERT_EQ(file_util::ReadFile(data_file, data.get(), data_file_size), | 68 ASSERT_EQ(file_util::ReadFile(data_file, data.get(), data_file_size), |
69 data_file_size); | 69 data_file_size); |
70 std::string json_string(data.get(), data_file_size); | 70 std::string json_string(data.get(), data_file_size); |
71 scoped_ptr<GpuBlacklist> blacklist(Create()); | 71 scoped_ptr<GpuBlacklist> blacklist(Create()); |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 Version os_version("10.6.4"); | 1084 Version os_version("10.6.4"); |
1085 | 1085 |
1086 scoped_ptr<GpuBlacklist> blacklist(Create()); | 1086 scoped_ptr<GpuBlacklist> blacklist(Create()); |
1087 EXPECT_TRUE(blacklist->LoadGpuBlacklist( | 1087 EXPECT_TRUE(blacklist->LoadGpuBlacklist( |
1088 video_decode_json, GpuBlacklist::kAllOs)); | 1088 video_decode_json, GpuBlacklist::kAllOs)); |
1089 GpuFeatureType type = blacklist->MakeBlacklistDecision( | 1089 GpuFeatureType type = blacklist->MakeBlacklistDecision( |
1090 GpuBlacklist::kOsMacosx, &os_version, | 1090 GpuBlacklist::kOsMacosx, &os_version, |
1091 gpu_info()).blacklisted_features; | 1091 gpu_info()).blacklisted_features; |
1092 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE); | 1092 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE); |
1093 } | 1093 } |
OLD | NEW |