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

Unified Diff: components/domain_reliability/config_unittest.cc

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: Rebase and address comments from mmenke@ Created 3 years, 11 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 | « components/domain_reliability/config.cc ('k') | components/domain_reliability/google_configs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/domain_reliability/config_unittest.cc
diff --git a/components/domain_reliability/config_unittest.cc b/components/domain_reliability/config_unittest.cc
index d8c7f6d2044bcf58df952d3bab5e3e6cf935760a..be701b0998a399b0034544bdbd0a3d011a7b6c76 100644
--- a/components/domain_reliability/config_unittest.cc
+++ b/components/domain_reliability/config_unittest.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <string>
+#include "base/memory/ptr_util.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,7 +18,8 @@ std::unique_ptr<DomainReliabilityConfig> MakeBaseConfig() {
DomainReliabilityConfig* config = new DomainReliabilityConfig();
config->origin = GURL("https://example/");
config->include_subdomains = false;
- config->collectors.push_back(new GURL("https://example/upload"));
+ config->collectors.push_back(
+ base::MakeUnique<GURL>("https://example/upload"));
config->failure_sample_rate = 1.0;
config->success_sample_rate = 0.0;
EXPECT_TRUE(config->IsValid());
@@ -26,8 +28,8 @@ std::unique_ptr<DomainReliabilityConfig> MakeBaseConfig() {
std::unique_ptr<DomainReliabilityConfig> MakeSampleConfig() {
std::unique_ptr<DomainReliabilityConfig> config(MakeBaseConfig());
- config->path_prefixes.push_back(new std::string("/css/"));
- config->path_prefixes.push_back(new std::string("/js/"));
+ config->path_prefixes.push_back(base::MakeUnique<std::string>("/css/"));
+ config->path_prefixes.push_back(base::MakeUnique<std::string>("/js/"));
EXPECT_TRUE(config->IsValid());
return config;
}
@@ -49,8 +51,7 @@ TEST_F(DomainReliabilityConfigTest, IsValid) {
EXPECT_FALSE(config->IsValid());
config = MakeSampleConfig();
- delete config->collectors[0];
- config->collectors[0] = new GURL();
+ config->collectors[0] = base::MakeUnique<GURL>();
EXPECT_FALSE(config->IsValid());
config = MakeSampleConfig();
« no previous file with comments | « components/domain_reliability/config.cc ('k') | components/domain_reliability/google_configs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698