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

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

Issue 1908953003: Convert //extensions/{common,shell} from scoped_ptr to std::unique_ptr (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 | « extensions/common/features/simple_feature.cc ('k') | extensions/common/file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/simple_feature_unittest.cc
diff --git a/extensions/common/features/simple_feature_unittest.cc b/extensions/common/features/simple_feature_unittest.cc
index afe8d7cef5d8baa85132f61c6731654515332564..098e21199455b0fab0fe54a42ae370734e2124bf 100644
--- a/extensions/common/features/simple_feature_unittest.cc
+++ b/extensions/common/features/simple_feature_unittest.cc
@@ -508,8 +508,8 @@ TEST_F(SimpleFeatureTest, ManifestVersion) {
}
TEST_F(SimpleFeatureTest, ParseNull) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
- scoped_ptr<SimpleFeature> feature(new SimpleFeature());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<SimpleFeature> feature(new SimpleFeature());
feature->Parse(value.get());
EXPECT_TRUE(feature->whitelist()->empty());
EXPECT_TRUE(feature->extension_types()->empty());
@@ -521,12 +521,12 @@ TEST_F(SimpleFeatureTest, ParseNull) {
}
TEST_F(SimpleFeatureTest, ParseWhitelist) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
base::ListValue* whitelist = new base::ListValue();
whitelist->Append(new base::StringValue("foo"));
whitelist->Append(new base::StringValue("bar"));
value->Set("whitelist", whitelist);
- scoped_ptr<SimpleFeature> feature(new SimpleFeature());
+ std::unique_ptr<SimpleFeature> feature(new SimpleFeature());
feature->Parse(value.get());
EXPECT_EQ(2u, feature->whitelist()->size());
EXPECT_TRUE(STLCount(*(feature->whitelist()), "foo"));
@@ -534,7 +534,7 @@ TEST_F(SimpleFeatureTest, ParseWhitelist) {
}
TEST_F(SimpleFeatureTest, ParsePackageTypes) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
base::ListValue* extension_types = new base::ListValue();
extension_types->Append(new base::StringValue("extension"));
extension_types->Append(new base::StringValue("theme"));
@@ -543,7 +543,7 @@ TEST_F(SimpleFeatureTest, ParsePackageTypes) {
extension_types->Append(new base::StringValue("platform_app"));
extension_types->Append(new base::StringValue("shared_module"));
value->Set("extension_types", extension_types);
- scoped_ptr<SimpleFeature> feature(new SimpleFeature());
+ std::unique_ptr<SimpleFeature> feature(new SimpleFeature());
feature->Parse(value.get());
EXPECT_EQ(6u, feature->extension_types()->size());
EXPECT_TRUE(
@@ -561,13 +561,13 @@ TEST_F(SimpleFeatureTest, ParsePackageTypes) {
STLCount(*(feature->extension_types()), Manifest::TYPE_SHARED_MODULE));
value->SetString("extension_types", "all");
- scoped_ptr<SimpleFeature> feature2(new SimpleFeature());
+ std::unique_ptr<SimpleFeature> feature2(new SimpleFeature());
feature2->Parse(value.get());
EXPECT_EQ(*(feature->extension_types()), *(feature2->extension_types()));
}
TEST_F(SimpleFeatureTest, ParseContexts) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
base::ListValue* contexts = new base::ListValue();
contexts->Append(new base::StringValue("blessed_extension"));
contexts->Append(new base::StringValue("unblessed_extension"));
@@ -576,7 +576,7 @@ TEST_F(SimpleFeatureTest, ParseContexts) {
contexts->Append(new base::StringValue("blessed_web_page"));
contexts->Append(new base::StringValue("webui"));
value->Set("contexts", contexts);
- scoped_ptr<SimpleFeature> feature(new SimpleFeature());
+ std::unique_ptr<SimpleFeature> feature(new SimpleFeature());
feature->Parse(value.get());
EXPECT_EQ(6u, feature->contexts()->size());
EXPECT_TRUE(
@@ -591,22 +591,22 @@ TEST_F(SimpleFeatureTest, ParseContexts) {
STLCount(*(feature->contexts()), Feature::BLESSED_WEB_PAGE_CONTEXT));
value->SetString("contexts", "all");
- scoped_ptr<SimpleFeature> feature2(new SimpleFeature());
+ std::unique_ptr<SimpleFeature> feature2(new SimpleFeature());
feature2->Parse(value.get());
EXPECT_EQ(*(feature->contexts()), *(feature2->contexts()));
}
TEST_F(SimpleFeatureTest, ParseLocation) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->SetString("location", "component");
- scoped_ptr<SimpleFeature> feature(new SimpleFeature());
+ std::unique_ptr<SimpleFeature> feature(new SimpleFeature());
feature->Parse(value.get());
EXPECT_EQ(SimpleFeature::COMPONENT_LOCATION, feature->location());
}
TEST_F(SimpleFeatureTest, ParsePlatforms) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
- scoped_ptr<SimpleFeature> feature(new SimpleFeature());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<SimpleFeature> feature(new SimpleFeature());
base::ListValue* platforms = new base::ListValue();
value->Set("platforms", platforms);
feature->Parse(value.get());
@@ -636,10 +636,10 @@ TEST_F(SimpleFeatureTest, ParsePlatforms) {
}
TEST_F(SimpleFeatureTest, ParseManifestVersion) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->SetInteger("min_manifest_version", 1);
value->SetInteger("max_manifest_version", 5);
- scoped_ptr<SimpleFeature> feature(new SimpleFeature());
+ std::unique_ptr<SimpleFeature> feature(new SimpleFeature());
feature->Parse(value.get());
EXPECT_EQ(1, feature->min_manifest_version());
EXPECT_EQ(5, feature->max_manifest_version());
« no previous file with comments | « extensions/common/features/simple_feature.cc ('k') | extensions/common/file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698