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

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

Issue 1880143002: Convert chrome/common to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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
Index: chrome/common/extensions/features/chrome_channel_feature_filter_unittest.cc
diff --git a/chrome/common/extensions/features/chrome_channel_feature_filter_unittest.cc b/chrome/common/extensions/features/chrome_channel_feature_filter_unittest.cc
index fe583d9d1ef2c28c4782c3603c2106a246e3f006..5367ab397d4160f6213e901237dd59397d09ba36 100644
--- a/chrome/common/extensions/features/chrome_channel_feature_filter_unittest.cc
+++ b/chrome/common/extensions/features/chrome_channel_feature_filter_unittest.cc
@@ -4,11 +4,11 @@
#include "chrome/common/extensions/features/chrome_channel_feature_filter.h"
+#include <memory>
#include <string>
#include <utility>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/common/extensions/features/feature_channel.h"
#include "components/version_info/version_info.h"
@@ -25,8 +25,8 @@ namespace {
template <class FeatureClass>
SimpleFeature* CreateFeature() {
SimpleFeature* feature = new FeatureClass();
- feature->AddFilter(
- scoped_ptr<SimpleFeatureFilter>(new ChromeChannelFeatureFilter(feature)));
+ feature->AddFilter(std::unique_ptr<SimpleFeatureFilter>(
+ new ChromeChannelFeatureFilter(feature)));
return feature;
}
@@ -36,7 +36,7 @@ Feature::AvailabilityResult IsAvailableInChannel(
ScopedCurrentChannel current_channel(channel_for_testing);
SimpleFeature feature;
- feature.AddFilter(scoped_ptr<SimpleFeatureFilter>(
+ feature.AddFilter(std::unique_ptr<SimpleFeatureFilter>(
new ChromeChannelFeatureFilter(&feature)));
base::DictionaryValue feature_value;
@@ -130,7 +130,7 @@ TEST_F(ChromeChannelFeatureFilterTest, SupportedChannel) {
// Tests the validation of features with channel entries.
TEST_F(ChromeChannelFeatureFilterTest, FeatureValidation) {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
base::DictionaryValue* feature1 = new base::DictionaryValue();
feature1->SetString("channel", "trunk");
@@ -146,7 +146,7 @@ TEST_F(ChromeChannelFeatureFilterTest, FeatureValidation) {
feature2->Set("contexts", contexts);
value->Set("feature2", feature2);
- scoped_ptr<BaseFeatureProvider> provider(
+ std::unique_ptr<BaseFeatureProvider> provider(
new BaseFeatureProvider(*value, CreateFeature<PermissionFeature>));
// feature1 won't validate because it lacks an extension type.
@@ -176,7 +176,7 @@ TEST_F(ChromeChannelFeatureFilterTest, FeatureValidation) {
// Tests simple feature availability across channels.
TEST_F(ChromeChannelFeatureFilterTest, SimpleFeatureAvailability) {
- scoped_ptr<base::DictionaryValue> rule(
+ std::unique_ptr<base::DictionaryValue> rule(
DictionaryBuilder()
.Set("feature1",
ListBuilder()
@@ -195,7 +195,7 @@ TEST_F(ChromeChannelFeatureFilterTest, SimpleFeatureAvailability) {
.Build())
.Build());
- scoped_ptr<BaseFeatureProvider> provider(
+ std::unique_ptr<BaseFeatureProvider> provider(
new BaseFeatureProvider(*rule, CreateFeature<SimpleFeature>));
Feature* feature = provider->GetFeature("feature1");
@@ -236,12 +236,12 @@ TEST_F(ChromeChannelFeatureFilterTest, SimpleFeatureAvailability) {
// Tests complex feature availability across channels.
TEST_F(ChromeChannelFeatureFilterTest, ComplexFeatureAvailability) {
- scoped_ptr<ComplexFeature::FeatureList> features(
+ std::unique_ptr<ComplexFeature::FeatureList> features(
new ComplexFeature::FeatureList());
// Rule: "extension", channel trunk.
- scoped_ptr<SimpleFeature> simple_feature(CreateFeature<SimpleFeature>());
- scoped_ptr<base::DictionaryValue> rule(
+ std::unique_ptr<SimpleFeature> simple_feature(CreateFeature<SimpleFeature>());
+ std::unique_ptr<base::DictionaryValue> rule(
DictionaryBuilder()
.Set("channel", "trunk")
.Set("extension_types", ListBuilder().Append("extension").Build())
@@ -259,7 +259,8 @@ TEST_F(ChromeChannelFeatureFilterTest, ComplexFeatureAvailability) {
simple_feature->Parse(rule.get());
features->push_back(std::move(simple_feature));
- scoped_ptr<ComplexFeature> feature(new ComplexFeature(std::move(features)));
+ std::unique_ptr<ComplexFeature> feature(
+ new ComplexFeature(std::move(features)));
// Test match 1st rule.
{
« no previous file with comments | « chrome/common/extensions/feature_switch_unittest.cc ('k') | chrome/common/extensions/manifest_handlers/app_icon_color_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698