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 19 matching lines...) Expand all Loading... |
30 const GPUInfo& gpu_info() const { | 30 const GPUInfo& gpu_info() const { |
31 return gpu_info_; | 31 return gpu_info_; |
32 } | 32 } |
33 | 33 |
34 GpuBlacklist* Create() { | 34 GpuBlacklist* Create() { |
35 GpuBlacklist* rt = new GpuBlacklist(); | 35 GpuBlacklist* rt = new GpuBlacklist(); |
36 return rt; | 36 return rt; |
37 } | 37 } |
38 | 38 |
39 protected: | 39 protected: |
40 void SetUp() { | 40 virtual void SetUp() { |
41 gpu_info_.gpu.vendor_id = kNvidiaVendorId; | 41 gpu_info_.gpu.vendor_id = kNvidiaVendorId; |
42 gpu_info_.gpu.device_id = 0x0640; | 42 gpu_info_.gpu.device_id = 0x0640; |
43 gpu_info_.driver_vendor = "NVIDIA"; | 43 gpu_info_.driver_vendor = "NVIDIA"; |
44 gpu_info_.driver_version = "1.6.18"; | 44 gpu_info_.driver_version = "1.6.18"; |
45 gpu_info_.driver_date = "7-14-2009"; | 45 gpu_info_.driver_date = "7-14-2009"; |
46 gpu_info_.machine_model = "MacBookPro 7.1"; | 46 gpu_info_.machine_model = "MacBookPro 7.1"; |
47 gpu_info_.gl_vendor = "NVIDIA Corporation"; | 47 gpu_info_.gl_vendor = "NVIDIA Corporation"; |
48 gpu_info_.gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine"; | 48 gpu_info_.gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine"; |
49 gpu_info_.performance_stats.graphics = 5.0; | 49 gpu_info_.performance_stats.graphics = 5.0; |
50 gpu_info_.performance_stats.gaming = 5.0; | 50 gpu_info_.performance_stats.gaming = 5.0; |
51 gpu_info_.performance_stats.overall = 5.0; | 51 gpu_info_.performance_stats.overall = 5.0; |
52 } | 52 } |
53 | 53 |
54 void TearDown() { | 54 virtual void TearDown() { |
55 } | 55 } |
56 | 56 |
57 private: | 57 private: |
58 GPUInfo gpu_info_; | 58 GPUInfo gpu_info_; |
59 }; | 59 }; |
60 | 60 |
61 TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { | 61 TEST_F(GpuBlacklistTest, CurrentBlacklistValidation) { |
62 base::FilePath data_file; | 62 base::FilePath data_file; |
63 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); | 63 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_file)); |
64 data_file = | 64 data_file = |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 | 1513 |
1514 scoped_ptr<GpuBlacklist> blacklist(Create()); | 1514 scoped_ptr<GpuBlacklist> blacklist(Create()); |
1515 EXPECT_TRUE(blacklist->LoadGpuBlacklist(json, GpuBlacklist::kAllOs)); | 1515 EXPECT_TRUE(blacklist->LoadGpuBlacklist(json, GpuBlacklist::kAllOs)); |
1516 GpuFeatureType type = blacklist->MakeBlacklistDecision( | 1516 GpuFeatureType type = blacklist->MakeBlacklistDecision( |
1517 GpuBlacklist::kOsLinux, kOsVersion, gpu_info).blacklisted_features; | 1517 GpuBlacklist::kOsLinux, kOsVersion, gpu_info).blacklisted_features; |
1518 EXPECT_EQ(GPU_FEATURE_TYPE_WEBGL, type); | 1518 EXPECT_EQ(GPU_FEATURE_TYPE_WEBGL, type); |
1519 EXPECT_FALSE(blacklist->needs_more_info()); | 1519 EXPECT_FALSE(blacklist->needs_more_info()); |
1520 } | 1520 } |
1521 | 1521 |
1522 } // namespace content | 1522 } // namespace content |
OLD | NEW |