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

Unified Diff: components/domain_reliability/config_unittest.cc

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: 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
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..4b6e557e4f765fb1789c61d3654956d1e263b324 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].reset(new GURL());
Avi (use Gerrit) 2017/01/09 17:18:29 Why not config->collectors[0] = base::MakeUnique<
leonhsl(Using Gerrit) 2017/01/10 04:39:36 Done.
EXPECT_FALSE(config->IsValid());
config = MakeSampleConfig();

Powered by Google App Engine
This is Rietveld 408576698