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

Side by Side Diff: chrome/common/extensions/features/chrome_channel_feature_filter_unittest.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698