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

Unified Diff: gpu/config/gpu_control_list_entry_unittest.cc

Issue 1925203002: Add exceptions to features in GpuControlList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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 f26e3acd5d5b99a01fa503250aef414b0d58fe0f..9228b976ec16af2bab08cdd615b97e9e32e135fc 100644
--- a/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -816,6 +816,53 @@ TEST_F(GpuControlListEntryTest, FeatureTypeAllEntry) {
EXPECT_EQ(1u, entry->features().count(TEST_FEATURE_2));
}
+TEST_F(GpuControlListEntryTest, FeatureTypeAllEntryWithExceptions) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "features": [
+ "all",
+ {"exceptions" : [
+ "test_feature_0"
+ ]}
+ ]
+ }
+ );
+ bool supports_feature_type_all = true;
+ ScopedEntry entry(GetEntryFromString(json, supports_feature_type_all));
+ EXPECT_TRUE(entry.get() != NULL);
+ EXPECT_EQ(1u, entry->features().count(TEST_FEATURE_1));
+ EXPECT_EQ(1u, entry->features().count(TEST_FEATURE_2));
+ EXPECT_EQ(2u, entry->features().size());
+
+ supports_feature_type_all = false;
+ entry = ScopedEntry(GetEntryFromString(json, supports_feature_type_all));
+ EXPECT_TRUE(entry.get() == NULL);
+}
+
+TEST_F(GpuControlListEntryTest, FeatureTypeAllEntryWithUnknownField) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "features": [
+ "all", {
+ "exceptions" : [
+ "test_feature_0"
+ ],
+ "unknown_field" : 0
+ }
+ ]
+ }
+ );
+ bool supports_feature_type_all = true;
+ ScopedEntry entry(GetEntryFromString(json, supports_feature_type_all));
+ EXPECT_TRUE(entry.get() == NULL);
+
+ supports_feature_type_all = false;
+ entry = ScopedEntry(GetEntryFromString(json, supports_feature_type_all));
+ EXPECT_TRUE(entry.get() == NULL);
+}
+
TEST_F(GpuControlListEntryTest, InvalidVendorIdEntry) {
const std::string json = LONG_STRING_CONST(
{
« 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