Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/gpu_blacklist_unittest.cc

Issue 10832044: Enhance GPU blacklist so we can also blacklist GPUs other than the primary one. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/gpu_blacklist.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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) {
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.
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 }
OLDNEW
« no previous file with comments | « chrome/browser/gpu_blacklist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698