OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/extensions/features/chrome_channel_feature_filter.h" | 5 #include "chrome/common/extensions/features/chrome_channel_feature_filter.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 TEST_F(ChromeChannelFeatureFilterTest, FeatureValidation) { | 132 TEST_F(ChromeChannelFeatureFilterTest, FeatureValidation) { |
133 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 133 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
134 | 134 |
135 base::DictionaryValue* feature1 = new base::DictionaryValue(); | 135 base::DictionaryValue* feature1 = new base::DictionaryValue(); |
136 feature1->SetString("channel", "trunk"); | 136 feature1->SetString("channel", "trunk"); |
137 value->Set("feature1", feature1); | 137 value->Set("feature1", feature1); |
138 | 138 |
139 base::DictionaryValue* feature2 = new base::DictionaryValue(); | 139 base::DictionaryValue* feature2 = new base::DictionaryValue(); |
140 feature2->SetString("channel", "trunk"); | 140 feature2->SetString("channel", "trunk"); |
141 base::ListValue* extension_types = new base::ListValue(); | 141 base::ListValue* extension_types = new base::ListValue(); |
142 extension_types->Append(new base::StringValue("extension")); | 142 extension_types->AppendString("extension"); |
143 feature2->Set("extension_types", extension_types); | 143 feature2->Set("extension_types", extension_types); |
144 base::ListValue* contexts = new base::ListValue(); | 144 base::ListValue* contexts = new base::ListValue(); |
145 contexts->Append(new base::StringValue("blessed_extension")); | 145 contexts->AppendString("blessed_extension"); |
146 feature2->Set("contexts", contexts); | 146 feature2->Set("contexts", contexts); |
147 value->Set("feature2", feature2); | 147 value->Set("feature2", feature2); |
148 | 148 |
149 std::unique_ptr<BaseFeatureProvider> provider( | 149 std::unique_ptr<BaseFeatureProvider> provider( |
150 new BaseFeatureProvider(*value, CreateFeature<PermissionFeature>)); | 150 new BaseFeatureProvider(*value, CreateFeature<PermissionFeature>)); |
151 | 151 |
152 // feature1 won't validate because it lacks an extension type. | 152 // feature1 won't validate because it lacks an extension type. |
153 EXPECT_FALSE(provider->GetFeature("feature1")); | 153 EXPECT_FALSE(provider->GetFeature("feature1")); |
154 | 154 |
155 // If we add one, it works. | 155 // If we add one, it works. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 Feature::IS_AVAILABLE, | 293 Feature::IS_AVAILABLE, |
294 feature->IsAvailableToManifest("1", | 294 feature->IsAvailableToManifest("1", |
295 Manifest::TYPE_EXTENSION, | 295 Manifest::TYPE_EXTENSION, |
296 Manifest::INVALID_LOCATION, | 296 Manifest::INVALID_LOCATION, |
297 Feature::UNSPECIFIED_PLATFORM, | 297 Feature::UNSPECIFIED_PLATFORM, |
298 Feature::GetCurrentPlatform()).result()); | 298 Feature::GetCurrentPlatform()).result()); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 } // namespace extensions | 302 } // namespace extensions |
OLD | NEW |