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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 gpu_info.driver_version = "8.21"; | 862 gpu_info.driver_version = "8.21"; |
863 type = blacklist->DetermineGpuFeatureType( | 863 type = blacklist->DetermineGpuFeatureType( |
864 GpuBlacklist::kOsLinux, &os_version, gpu_info); | 864 GpuBlacklist::kOsLinux, &os_version, gpu_info); |
865 EXPECT_EQ(type, 0); | 865 EXPECT_EQ(type, 0); |
866 | 866 |
867 gpu_info.driver_version = "8.2010"; | 867 gpu_info.driver_version = "8.2010"; |
868 type = blacklist->DetermineGpuFeatureType( | 868 type = blacklist->DetermineGpuFeatureType( |
869 GpuBlacklist::kOsLinux, &os_version, gpu_info); | 869 GpuBlacklist::kOsLinux, &os_version, gpu_info); |
870 EXPECT_EQ(type, 0); | 870 EXPECT_EQ(type, 0); |
871 } | 871 } |
| 872 |
| 873 TEST_F(GpuBlacklistTest, MultipleGPUs) { |
| 874 const std::string multi_gpu_json = |
| 875 "{\n" |
| 876 " \"name\": \"gpu blacklist\",\n" |
| 877 " \"version\": \"0.1\",\n" |
| 878 " \"entries\": [\n" |
| 879 " {\n" |
| 880 " \"id\": 1,\n" |
| 881 " \"os\": {\n" |
| 882 " \"type\": \"macosx\"\n" |
| 883 " },\n" |
| 884 " \"vendor_id\": \"0x8086\",\n" |
| 885 " \"device_id\": [\"0x0166\"],\n" |
| 886 " \"multi_gpu_category\": \"any\",\n" |
| 887 " \"blacklist\": [\n" |
| 888 " \"webgl\"\n" |
| 889 " ]\n" |
| 890 " }\n" |
| 891 " ]\n" |
| 892 "}"; |
| 893 Version os_version("10.6.4"); |
| 894 |
| 895 content::GPUInfo gpu_info; |
| 896 gpu_info.gpu.vendor_id = 0x10de; |
| 897 gpu_info.gpu.device_id = 0x0fd5; |
| 898 |
| 899 scoped_ptr<GpuBlacklist> blacklist(Create()); |
| 900 EXPECT_TRUE(blacklist->LoadGpuBlacklist( |
| 901 multi_gpu_json, GpuBlacklist::kAllOs)); |
| 902 GpuFeatureType type = blacklist->DetermineGpuFeatureType( |
| 903 GpuBlacklist::kOsMacosx, &os_version, gpu_info); |
| 904 EXPECT_EQ(type, 0); |
| 905 |
| 906 content::GPUInfo::GPUDevice gpu_device; |
| 907 gpu_device.vendor_id = 0x8086; |
| 908 gpu_device.device_id = 0x0166; |
| 909 gpu_info.secondary_gpus.push_back(gpu_device); |
| 910 type = blacklist->DetermineGpuFeatureType( |
| 911 GpuBlacklist::kOsMacosx, &os_version, gpu_info); |
| 912 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); |
| 913 } |
OLD | NEW |