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

Unified Diff: chrome/common/extensions/features/base_feature_provider_unittest.cc

Issue 15091002: Lazily load API schemas from resource files and convert all APIs to features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos tests Created 7 years, 6 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
Index: chrome/common/extensions/features/base_feature_provider_unittest.cc
diff --git a/chrome/common/extensions/features/base_feature_provider_unittest.cc b/chrome/common/extensions/features/base_feature_provider_unittest.cc
index 4b94fb1464bb6ec6d3ff9836cbaab48c5d61c8f9..d9f1b2855976df4bba1bd25367ef48f9267c9c88 100644
--- a/chrome/common/extensions/features/base_feature_provider_unittest.cc
+++ b/chrome/common/extensions/features/base_feature_provider_unittest.cc
@@ -104,9 +104,11 @@ TEST(BaseFeatureProviderTest, Validation) {
scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
base::DictionaryValue* feature1 = new base::DictionaryValue();
+ feature1->SetString("channel", "trunk");
value->Set("feature1", feature1);
base::DictionaryValue* feature2 = new base::DictionaryValue();
+ feature2->SetString("channel", "trunk");
base::ListValue* extension_types = new base::ListValue();
extension_types->Append(new base::StringValue("extension"));
feature2->Set("extension_types", extension_types);
@@ -126,6 +128,11 @@ TEST(BaseFeatureProviderTest, Validation) {
provider.reset(new BaseFeatureProvider(*value, CreatePermissionFeature));
EXPECT_TRUE(provider->GetFeature("feature1"));
+ // Remove the channel, and feature1 won't validate.
+ feature1->Remove("channel", NULL);
+ provider.reset(new BaseFeatureProvider(*value, CreatePermissionFeature));
+ EXPECT_FALSE(provider->GetFeature("feature1"));
+
// feature2 won't validate because of the presence of "contexts".
EXPECT_FALSE(provider->GetFeature("feature2"));
« no previous file with comments | « chrome/common/extensions/features/base_feature_provider.cc ('k') | chrome/common/extensions/features/feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698