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

Unified Diff: extensions/common/features/complex_feature_unittest.cc

Issue 2201653003: Revert of Further reduction of feature_compiler.py generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test-with-leiz
Patch Set: Created 4 years, 5 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 | « extensions/common/features/complex_feature.cc ('k') | extensions/common/features/json_feature_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/complex_feature_unittest.cc
diff --git a/extensions/common/features/complex_feature_unittest.cc b/extensions/common/features/complex_feature_unittest.cc
index 426afd70c4b1bd54b54013c19dade2797b5291dd..bff752dd8549a7fea88840bd04d8c2a6b06b77d0 100644
--- a/extensions/common/features/complex_feature_unittest.cc
+++ b/extensions/common/features/complex_feature_unittest.cc
@@ -17,7 +17,8 @@
TEST(ComplexFeatureTest, MultipleRulesWhitelist) {
const std::string kIdFoo("fooabbbbccccddddeeeeffffgggghhhh");
const std::string kIdBar("barabbbbccccddddeeeeffffgggghhhh");
- std::vector<Feature*> features;
+ std::unique_ptr<ComplexFeature::FeatureList> features(
+ new ComplexFeature::FeatureList());
// Rule: "extension", whitelist "foo".
std::unique_ptr<SimpleFeature> simple_feature(new SimpleFeature);
@@ -27,7 +28,7 @@
.Set("extension_types", ListBuilder().Append("extension").Build())
.Build());
simple_feature->Parse(rule.get());
- features.push_back(simple_feature.release());
+ features->push_back(std::move(simple_feature));
// Rule: "legacy_packaged_app", whitelist "bar".
simple_feature.reset(new SimpleFeature);
@@ -37,9 +38,10 @@
ListBuilder().Append("legacy_packaged_app").Build())
.Build();
simple_feature->Parse(rule.get());
- features.push_back(simple_feature.release());
+ features->push_back(std::move(simple_feature));
- std::unique_ptr<ComplexFeature> feature(new ComplexFeature(&features));
+ std::unique_ptr<ComplexFeature> feature(
+ new ComplexFeature(std::move(features)));
// Test match 1st rule.
EXPECT_EQ(
@@ -78,7 +80,8 @@
// Tests that dependencies are correctly checked.
TEST(ComplexFeatureTest, Dependencies) {
- std::vector<Feature*> features;
+ std::unique_ptr<ComplexFeature::FeatureList> features(
+ new ComplexFeature::FeatureList());
// Rule which depends on an extension-only feature (content_security_policy).
std::unique_ptr<SimpleFeature> simple_feature(new SimpleFeature);
@@ -88,7 +91,7 @@
ListBuilder().Append("manifest:content_security_policy").Build())
.Build();
simple_feature->Parse(rule.get());
- features.push_back(simple_feature.release());
+ features->push_back(std::move(simple_feature));
// Rule which depends on an platform-app-only feature (serial).
simple_feature.reset(new SimpleFeature);
@@ -97,9 +100,10 @@
ListBuilder().Append("permission:serial").Build())
.Build();
simple_feature->Parse(rule.get());
- features.push_back(simple_feature.release());
+ features->push_back(std::move(simple_feature));
- std::unique_ptr<ComplexFeature> feature(new ComplexFeature(&features));
+ std::unique_ptr<ComplexFeature> feature(
+ new ComplexFeature(std::move(features)));
// Available to extensions because of the content_security_policy rule.
EXPECT_EQ(
« no previous file with comments | « extensions/common/features/complex_feature.cc ('k') | extensions/common/features/json_feature_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698