summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-29 21:22:30 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-29 21:22:30 +0000
commit936a61c9be17dc3d01f5a3f95aef11646485745f (patch)
treee04f10504df3c8209c23ae031642a8c89e444991
parentebe261c4b3f5f28fd55dc53e156c04156e3607fa (diff)
downloadchromium_src-936a61c9be17dc3d01f5a3f95aef11646485745f.zip
chromium_src-936a61c9be17dc3d01f5a3f95aef11646485745f.tar.gz
chromium_src-936a61c9be17dc3d01f5a3f95aef11646485745f.tar.bz2
Missing machine model info should be a no match for GPU blacklist
BUG=368006 TEST=gpu_unittests, on win/linux, gpu_rasterization is off R=kbr@chromium.org Review URL: https://codereview.chromium.org/253883006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266963 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--gpu/config/gpu_control_list.cc9
-rw-r--r--gpu/config/gpu_control_list_entry_unittest.cc79
-rw-r--r--gpu/config/software_rendering_list_json.cc5
3 files changed, 88 insertions, 5 deletions
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index b5e37c7..30593ed 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -1121,8 +1121,9 @@ bool GpuControlList::GpuControlListEntry::Contains(
(gpu_info.performance_stats.overall == 0.0 ||
!perf_overall_info_->Contains(gpu_info.performance_stats.overall)))
return false;
- if (!machine_model_name_list_.empty() &&
- !gpu_info.machine_model_name.empty()) {
+ if (!machine_model_name_list_.empty()) {
+ if (gpu_info.machine_model_name.empty())
+ return false;
bool found_match = false;
for (size_t ii = 0; ii < machine_model_name_list_.size(); ++ii) {
if (machine_model_name_list_[ii] == gpu_info.machine_model_name) {
@@ -1134,8 +1135,8 @@ bool GpuControlList::GpuControlListEntry::Contains(
return false;
}
if (machine_model_version_info_.get() != NULL &&
- !gpu_info.machine_model_version.empty() &&
- !machine_model_version_info_->Contains(gpu_info.machine_model_version))
+ (gpu_info.machine_model_version.empty() ||
+ !machine_model_version_info_->Contains(gpu_info.machine_model_version)))
return false;
if (gpu_count_info_.get() != NULL &&
!gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1))
diff --git a/gpu/config/gpu_control_list_entry_unittest.cc b/gpu/config/gpu_control_list_entry_unittest.cc
index 849d201..7caad43 100644
--- a/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -743,6 +743,45 @@ TEST_F(GpuControlListEntryTest, MachineModelName) {
gpu_info.machine_model_name = "Nexus";
EXPECT_FALSE(entry->Contains(
GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+}
+
+TEST_F(GpuControlListEntryTest, MachineModelNameException) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "exceptions": [
+ {
+ "os": {
+ "type": "android"
+ },
+ "machine_model_name": ["Nexus 4"]
+ }
+ ],
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+ EXPECT_EQ(GpuControlList::kOsAny, entry->GetOsType());
+ GPUInfo gpu_info;
+
+ gpu_info.machine_model_name = "Nexus 4";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsLinux, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsLinux, "4.1", gpu_info));
}
TEST_F(GpuControlListEntryTest, MachineModelVersion) {
@@ -772,6 +811,46 @@ TEST_F(GpuControlListEntryTest, MachineModelVersion) {
GpuControlList::kOsMacosx, "10.6", gpu_info));
}
+TEST_F(GpuControlListEntryTest, MachineModelVersionException) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "machine_model_name": ["MacBookPro"],
+ "exceptions": [
+ {
+ "machine_model_version": {
+ "op": ">",
+ "value": "7.1"
+ }
+ }
+ ],
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+ EXPECT_EQ(GpuControlList::kOsMacosx, entry->GetOsType());
+
+ GPUInfo gpu_info;
+ gpu_info.machine_model_name = "MacBookPro";
+ gpu_info.machine_model_version = "7.0";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.6", gpu_info));
+
+ gpu_info.machine_model_version = "7.2";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.6", gpu_info));
+
+ gpu_info.machine_model_version = "";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.6", gpu_info));
+}
+
class GpuControlListEntryDualGPUTest : public GpuControlListEntryTest {
public:
GpuControlListEntryDualGPUTest() { }
diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc
index 0c0724e..7715b50 100644
--- a/gpu/config/software_rendering_list_json.cc
+++ b/gpu/config/software_rendering_list_json.cc
@@ -18,7 +18,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"name": "software rendering list",
// Please update the version number whenever you change this file.
- "version": "8.0",
+ "version": "8.1",
"entries": [
{
"id": 1,
@@ -1127,6 +1127,9 @@ LONG_STRING_CONST(
"cr_bugs": [362779],
"exceptions": [
{
+ "os": {
+ "type": "android"
+ },
"machine_model_name": ["Nexus 4", "Nexus 5", "Nexus 7",
"XT1049", "XT1050", "XT1052", "XT1053",
"XT1055", "XT1056", "XT1058", "XT1060"]