Chromium Code Reviews| Index: gpu/config/gpu_test_config.cc |
| diff --git a/gpu/config/gpu_test_config.cc b/gpu/config/gpu_test_config.cc |
| index d63e283a638718d237acacbc46e3595836b8b1f0..5782a038155e5d8c23b201825ae637c8c9be80b5 100644 |
| --- a/gpu/config/gpu_test_config.cc |
| +++ b/gpu/config/gpu_test_config.cc |
| @@ -114,6 +114,11 @@ void GPUTestConfig::set_api(int32_t api) { |
| api_ = api; |
| } |
| +void GPUTestConfig::set_machine_model_name( |
| + const std::string& machine_model_name) { |
| + machine_model_name_ = machine_model_name; |
| +} |
| + |
| bool GPUTestConfig::IsValid() const { |
| if (!validate_gpu_info_) |
| return true; |
| @@ -148,6 +153,9 @@ bool GPUTestConfig::OverlapsWith(const GPUTestConfig& config) const { |
| build_type_ != kBuildTypeUnknown && |
| (build_type_ & config.build_type_) == 0) |
| return false; |
| + if (!config.machine_model_name_.empty() && !machine_model_name_.empty() && |
| + config.machine_model_name_ != machine_model_name_) |
|
Zhenyao Mo
2017/03/11 18:29:16
Can you add a unit test for this?
|
| + return false; |
| return true; |
| } |
| @@ -174,6 +182,7 @@ bool GPUTestBotConfig::SetGPUInfo(const GPUInfo& gpu_info) { |
| ClearGPUVendor(); |
| AddGPUVendor(gpu_info.gpu.vendor_id); |
| set_gpu_device_id(gpu_info.gpu.device_id); |
| + set_machine_model_name(gpu_info.machine_model_name); |
| return true; |
| } |
| @@ -239,6 +248,9 @@ bool GPUTestBotConfig::Matches(const GPUTestConfig& config) const { |
| return false; |
| if (config.api() != 0 && (api() & config.api()) == 0) |
| return false; |
| + if (!config.machine_model_name().empty() && |
|
Zhenyao Mo
2017/03/11 18:29:16
Can you add a unit test for this?
|
| + machine_model_name() != config.machine_model_name()) |
| + return false; |
| return true; |
| } |