Chromium Code Reviews| Index: chrome/browser/gpu_blacklist_unittest.cc |
| =================================================================== |
| --- chrome/browser/gpu_blacklist_unittest.cc (revision 148446) |
| +++ chrome/browser/gpu_blacklist_unittest.cc (working copy) |
| @@ -869,3 +869,45 @@ |
| GpuBlacklist::kOsLinux, &os_version, gpu_info); |
| EXPECT_EQ(type, 0); |
| } |
| + |
| +TEST_F(GpuBlacklistTest, MultipleGPUs) { |
|
Ken Russell (switch to Gerrit)
2012/07/30 19:13:52
Please add one more test which verifies the multi_
Zhenyao Mo
2012/07/30 19:35:12
Done.
|
| + const std::string multi_gpu_json = |
| + "{\n" |
| + " \"name\": \"gpu blacklist\",\n" |
| + " \"version\": \"0.1\",\n" |
| + " \"entries\": [\n" |
| + " {\n" |
| + " \"id\": 1,\n" |
| + " \"os\": {\n" |
| + " \"type\": \"macosx\"\n" |
| + " },\n" |
| + " \"vendor_id\": \"0x8086\",\n" |
| + " \"device_id\": [\"0x0166\"],\n" |
| + " \"multi_gpu_category\": \"any\",\n" |
| + " \"blacklist\": [\n" |
| + " \"webgl\"\n" |
| + " ]\n" |
| + " }\n" |
| + " ]\n" |
| + "}"; |
| + Version os_version("10.6.4"); |
| + |
| + content::GPUInfo gpu_info; |
| + gpu_info.gpu.vendor_id = 0x10de; |
| + gpu_info.gpu.device_id = 0x0fd5; |
| + |
| + scoped_ptr<GpuBlacklist> blacklist(Create()); |
| + EXPECT_TRUE(blacklist->LoadGpuBlacklist( |
| + multi_gpu_json, GpuBlacklist::kAllOs)); |
| + GpuFeatureType type = blacklist->DetermineGpuFeatureType( |
| + GpuBlacklist::kOsMacosx, &os_version, gpu_info); |
| + EXPECT_EQ(type, 0); |
| + |
| + content::GPUInfo::GPUDevice gpu_device; |
| + gpu_device.vendor_id = 0x8086; |
| + gpu_device.device_id = 0x0166; |
| + gpu_info.secondary_gpus.push_back(gpu_device); |
| + type = blacklist->DetermineGpuFeatureType( |
| + GpuBlacklist::kOsMacosx, &os_version, gpu_info); |
| + EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); |
| +} |