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 "content/test/gpu/gpu_test_config.h" | 5 #include "content/test/gpu/gpu_test_config.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
9 #include "content/gpu/gpu_info_collector.h" | 9 #include "content/gpu/gpu_info_collector.h" |
10 #include "content/public/common/gpu_info.h" | 10 #include "content/public/common/gpu_info.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 if (major_version == 10) { | 38 if (major_version == 10) { |
39 switch (minor_version) { | 39 switch (minor_version) { |
40 case 5: | 40 case 5: |
41 return GPUTestConfig::kOsMacLeopard; | 41 return GPUTestConfig::kOsMacLeopard; |
42 case 6: | 42 case 6: |
43 return GPUTestConfig::kOsMacSnowLeopard; | 43 return GPUTestConfig::kOsMacSnowLeopard; |
44 case 7: | 44 case 7: |
45 return GPUTestConfig::kOsMacLion; | 45 return GPUTestConfig::kOsMacLion; |
46 } | 46 } |
47 } | 47 } |
| 48 #elif defined(OS_ANDROID) |
| 49 return GPUTestConfig::kOsAndroid; |
48 #endif | 50 #endif |
49 return GPUTestConfig::kOsUnknown; | 51 return GPUTestConfig::kOsUnknown; |
50 } | 52 } |
51 | 53 |
52 } // namespace anonymous | 54 } // namespace anonymous |
53 | 55 |
54 GPUTestConfig::GPUTestConfig() | 56 GPUTestConfig::GPUTestConfig() |
55 : os_(kOsUnknown), | 57 : os_(kOsUnknown), |
56 gpu_device_id_(0), | 58 gpu_device_id_(0), |
57 build_type_(kBuildTypeUnknown) { | 59 build_type_(kBuildTypeUnknown) { |
58 } | 60 } |
59 | 61 |
60 GPUTestConfig::~GPUTestConfig() { | 62 GPUTestConfig::~GPUTestConfig() { |
61 } | 63 } |
62 | 64 |
63 void GPUTestConfig::set_os(int32 os) { | 65 void GPUTestConfig::set_os(int32 os) { |
64 DCHECK_EQ(0, os & ~(kOsWin | kOsMac | kOsLinux | kOsChromeOS)); | 66 DCHECK_EQ(0, os & ~(kOsAndroid | kOsWin | kOsMac | kOsLinux | kOsChromeOS)); |
65 os_ = os; | 67 os_ = os; |
66 } | 68 } |
67 | 69 |
68 void GPUTestConfig::AddGPUVendor(uint32 gpu_vendor) { | 70 void GPUTestConfig::AddGPUVendor(uint32 gpu_vendor) { |
69 DCHECK_NE(0u, gpu_vendor); | 71 DCHECK_NE(0u, gpu_vendor); |
70 for (size_t i = 0; i < gpu_vendor_.size(); ++i) | 72 for (size_t i = 0; i < gpu_vendor_.size(); ++i) |
71 DCHECK_NE(gpu_vendor_[i], gpu_vendor); | 73 DCHECK_NE(gpu_vendor_[i], gpu_vendor); |
72 gpu_vendor_.push_back(gpu_vendor); | 74 gpu_vendor_.push_back(gpu_vendor); |
73 } | 75 } |
74 | 76 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 bool GPUTestBotConfig::IsValid() const { | 142 bool GPUTestBotConfig::IsValid() const { |
141 switch (os()) { | 143 switch (os()) { |
142 case kOsWinXP: | 144 case kOsWinXP: |
143 case kOsWinVista: | 145 case kOsWinVista: |
144 case kOsWin7: | 146 case kOsWin7: |
145 case kOsMacLeopard: | 147 case kOsMacLeopard: |
146 case kOsMacSnowLeopard: | 148 case kOsMacSnowLeopard: |
147 case kOsMacLion: | 149 case kOsMacLion: |
148 case kOsLinux: | 150 case kOsLinux: |
149 case kOsChromeOS: | 151 case kOsChromeOS: |
| 152 case kOsAndroid: |
150 break; | 153 break; |
151 default: | 154 default: |
152 return false; | 155 return false; |
153 } | 156 } |
154 if (gpu_vendor().size() != 1 || gpu_vendor()[0] == 0) | 157 if (gpu_vendor().size() != 1 || gpu_vendor()[0] == 0) |
155 return false; | 158 return false; |
156 if (gpu_device_id() == 0) | 159 if (gpu_device_id() == 0) |
157 return false; | 160 return false; |
158 switch (build_type()) { | 161 switch (build_type()) { |
159 case kBuildTypeRelease: | 162 case kBuildTypeRelease: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 GPUTestBotConfig my_config; | 236 GPUTestBotConfig my_config; |
234 if (!my_config.LoadCurrentConfig(NULL)) | 237 if (!my_config.LoadCurrentConfig(NULL)) |
235 return false; | 238 return false; |
236 for (size_t i = 0 ; i < configs.size(); ++i) { | 239 for (size_t i = 0 ; i < configs.size(); ++i) { |
237 if (my_config.Matches(configs[i])) | 240 if (my_config.Matches(configs[i])) |
238 return true; | 241 return true; |
239 } | 242 } |
240 return false; | 243 return false; |
241 } | 244 } |
242 | 245 |
OLD | NEW |