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

Unified Diff: gpu/config/gpu_control_list_entry_unittest.cc

Issue 253883006: Missing machine model info should be a no match for GPU blacklist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/config/gpu_control_list.cc ('k') | gpu/config/software_rendering_list_json.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_control_list_entry_unittest.cc
diff --git a/gpu/config/gpu_control_list_entry_unittest.cc b/gpu/config/gpu_control_list_entry_unittest.cc
index 849d201524bfd557285c31199cc284915c84edb5..7caad43054f6abfdbb425212b3f01ccd26cbebd0 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() { }
« no previous file with comments | « gpu/config/gpu_control_list.cc ('k') | gpu/config/software_rendering_list_json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698