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

Unified Diff: gpu/config/gpu_control_list_entry_unittest.cc

Issue 241793002: Fix machine_model behaviors in gpu blacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/gpu_control_list_format.txt » ('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 b62be3e6606b9bbe3d1475f6216b5b7d5f731d69..849d201524bfd557285c31199cc284915c84edb5 100644
--- a/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -56,7 +56,6 @@ class GpuControlListEntryTest : public testing::Test {
gpu_info_.driver_vendor = "NVIDIA";
gpu_info_.driver_version = "1.6.18";
gpu_info_.driver_date = "7-14-2009";
- gpu_info_.machine_model = "MacBookPro 7.1";
gpu_info_.gl_vendor = "NVIDIA Corporation";
gpu_info_.gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine";
gpu_info_.performance_stats.graphics = 5.0;
@@ -707,6 +706,72 @@ TEST_F(GpuControlListEntryTest, SingleActiveGPU) {
GpuControlList::kOsMacosx, "10.6", gpu_info()));
}
+TEST_F(GpuControlListEntryTest, MachineModelName) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "android"
+ },
+ "machine_model_name": ["Nexus 4", "XT1032"],
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+ EXPECT_EQ(GpuControlList::kOsAndroid, entry->GetOsType());
+ GPUInfo gpu_info;
+
+ gpu_info.machine_model_name = "Nexus 4";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "XT1032";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "XT1032i";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "Nexus 5";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "Nexus";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+}
+
+TEST_F(GpuControlListEntryTest, MachineModelVersion) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "os": {
+ "type": "macosx"
+ },
+ "machine_model_name": ["MacBookPro"],
+ "machine_model_version": {
+ "op": "=",
+ "value": "7.1"
+ },
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+ GPUInfo gpu_info;
+ gpu_info.machine_model_name = "MacBookPro";
+ gpu_info.machine_model_version = "7.1";
+ EXPECT_EQ(GpuControlList::kOsMacosx, entry->GetOsType());
+ 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/gpu_control_list_format.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698