Commit 936a61c9 authored by alokp@chromium.org's avatar alokp@chromium.org

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
parent ebe261c4
...@@ -1121,8 +1121,9 @@ bool GpuControlList::GpuControlListEntry::Contains( ...@@ -1121,8 +1121,9 @@ bool GpuControlList::GpuControlListEntry::Contains(
(gpu_info.performance_stats.overall == 0.0 || (gpu_info.performance_stats.overall == 0.0 ||
!perf_overall_info_->Contains(gpu_info.performance_stats.overall))) !perf_overall_info_->Contains(gpu_info.performance_stats.overall)))
return false; return false;
if (!machine_model_name_list_.empty() && if (!machine_model_name_list_.empty()) {
!gpu_info.machine_model_name.empty()) { if (gpu_info.machine_model_name.empty())
return false;
bool found_match = false; bool found_match = false;
for (size_t ii = 0; ii < machine_model_name_list_.size(); ++ii) { for (size_t ii = 0; ii < machine_model_name_list_.size(); ++ii) {
if (machine_model_name_list_[ii] == gpu_info.machine_model_name) { if (machine_model_name_list_[ii] == gpu_info.machine_model_name) {
...@@ -1134,8 +1135,8 @@ bool GpuControlList::GpuControlListEntry::Contains( ...@@ -1134,8 +1135,8 @@ bool GpuControlList::GpuControlListEntry::Contains(
return false; return false;
} }
if (machine_model_version_info_.get() != NULL && if (machine_model_version_info_.get() != NULL &&
!gpu_info.machine_model_version.empty() && (gpu_info.machine_model_version.empty() ||
!machine_model_version_info_->Contains(gpu_info.machine_model_version)) !machine_model_version_info_->Contains(gpu_info.machine_model_version)))
return false; return false;
if (gpu_count_info_.get() != NULL && if (gpu_count_info_.get() != NULL &&
!gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1)) !gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1))
......
...@@ -743,6 +743,45 @@ TEST_F(GpuControlListEntryTest, MachineModelName) { ...@@ -743,6 +743,45 @@ TEST_F(GpuControlListEntryTest, MachineModelName) {
gpu_info.machine_model_name = "Nexus"; gpu_info.machine_model_name = "Nexus";
EXPECT_FALSE(entry->Contains( EXPECT_FALSE(entry->Contains(
GpuControlList::kOsAndroid, "4.1", gpu_info)); 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) { TEST_F(GpuControlListEntryTest, MachineModelVersion) {
...@@ -772,6 +811,46 @@ TEST_F(GpuControlListEntryTest, MachineModelVersion) { ...@@ -772,6 +811,46 @@ TEST_F(GpuControlListEntryTest, MachineModelVersion) {
GpuControlList::kOsMacosx, "10.6", gpu_info)); 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 { class GpuControlListEntryDualGPUTest : public GpuControlListEntryTest {
public: public:
GpuControlListEntryDualGPUTest() { } GpuControlListEntryDualGPUTest() { }
......
...@@ -18,7 +18,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST( ...@@ -18,7 +18,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{ {
"name": "software rendering list", "name": "software rendering list",
// Please update the version number whenever you change this file. // Please update the version number whenever you change this file.
"version": "8.0", "version": "8.1",
"entries": [ "entries": [
{ {
"id": 1, "id": 1,
...@@ -1127,6 +1127,9 @@ LONG_STRING_CONST( ...@@ -1127,6 +1127,9 @@ LONG_STRING_CONST(
"cr_bugs": [362779], "cr_bugs": [362779],
"exceptions": [ "exceptions": [
{ {
"os": {
"type": "android"
},
"machine_model_name": ["Nexus 4", "Nexus 5", "Nexus 7", "machine_model_name": ["Nexus 4", "Nexus 5", "Nexus 7",
"XT1049", "XT1050", "XT1052", "XT1053", "XT1049", "XT1050", "XT1052", "XT1053",
"XT1055", "XT1056", "XT1058", "XT1060"] "XT1055", "XT1056", "XT1058", "XT1060"]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment