| Index: components/metrics/metrics_log_manager_unittest.cc
|
| diff --git a/components/metrics/metrics_log_manager_unittest.cc b/components/metrics/metrics_log_manager_unittest.cc
|
| index c35d10043b7a5425533147ae3b5046f18301be65..7a634609a54c471741f71c6a2c623421b1c93cf8 100644
|
| --- a/components/metrics/metrics_log_manager_unittest.cc
|
| +++ b/components/metrics/metrics_log_manager_unittest.cc
|
| @@ -10,6 +10,7 @@
|
| #include <utility>
|
| #include <vector>
|
|
|
| +#include "base/memory/ptr_util.h"
|
| #include "components/metrics/metrics_log.h"
|
| #include "components/metrics/metrics_pref_names.h"
|
| #include "components/metrics/test_metrics_service_client.h"
|
| @@ -55,7 +56,7 @@ TEST(MetricsLogManagerTest, StandardFlow) {
|
| // Check that the normal flow works.
|
| MetricsLog* initial_log = new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service);
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(initial_log));
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(initial_log));
|
| EXPECT_EQ(initial_log, log_manager.current_log());
|
| EXPECT_FALSE(log_manager.has_staged_log());
|
|
|
| @@ -66,7 +67,7 @@ TEST(MetricsLogManagerTest, StandardFlow) {
|
|
|
| MetricsLog* second_log =
|
| new MetricsLog("id", 0, MetricsLog::ONGOING_LOG, &client, &pref_service);
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(second_log));
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(second_log));
|
| EXPECT_EQ(second_log, log_manager.current_log());
|
|
|
| log_manager.StageNextLogForUpload();
|
| @@ -88,7 +89,7 @@ TEST(MetricsLogManagerTest, AbandonedLog) {
|
|
|
| MetricsLog* dummy_log = new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service);
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(dummy_log));
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(dummy_log));
|
| EXPECT_EQ(dummy_log, log_manager.current_log());
|
|
|
| log_manager.DiscardCurrentLog();
|
| @@ -106,13 +107,13 @@ TEST(MetricsLogManagerTest, InterjectedLog) {
|
| MetricsLog* temp_log = new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service);
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(ongoing_log));
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(ongoing_log));
|
| EXPECT_EQ(ongoing_log, log_manager.current_log());
|
|
|
| log_manager.PauseCurrentLog();
|
| EXPECT_EQ(NULL, log_manager.current_log());
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(temp_log));
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(temp_log));
|
| EXPECT_EQ(temp_log, log_manager.current_log());
|
| log_manager.FinishCurrentLog();
|
| EXPECT_EQ(NULL, log_manager.current_log());
|
| @@ -132,10 +133,10 @@ TEST(MetricsLogManagerTest, InterjectedLogPreservesType) {
|
| MetricsLogManager log_manager(&pref_service, 0);
|
| log_manager.LoadPersistedUnsentLogs();
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::ONGOING_LOG, &client, &pref_service)));
|
| log_manager.PauseCurrentLog();
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service)));
|
| log_manager.FinishCurrentLog();
|
| log_manager.ResumePausedLog();
|
| @@ -172,10 +173,10 @@ TEST(MetricsLogManagerTest, StoreAndLoad) {
|
| log_manager.LoadPersistedUnsentLogs();
|
| EXPECT_TRUE(log_manager.has_unsent_logs());
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service)));
|
| log_manager.FinishCurrentLog();
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::ONGOING_LOG, &client, &pref_service)));
|
| log_manager.StageNextLogForUpload();
|
| log_manager.FinishCurrentLog();
|
| @@ -233,7 +234,7 @@ TEST(MetricsLogManagerTest, StoreStagedLogTypes) {
|
| MetricsLogManager log_manager(&pref_service, 0);
|
| log_manager.LoadPersistedUnsentLogs();
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::ONGOING_LOG, &client, &pref_service)));
|
| log_manager.FinishCurrentLog();
|
| log_manager.StageNextLogForUpload();
|
| @@ -248,7 +249,7 @@ TEST(MetricsLogManagerTest, StoreStagedLogTypes) {
|
| MetricsLogManager log_manager(&pref_service, 0);
|
| log_manager.LoadPersistedUnsentLogs();
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service)));
|
| log_manager.FinishCurrentLog();
|
| log_manager.StageNextLogForUpload();
|
| @@ -266,10 +267,10 @@ TEST(MetricsLogManagerTest, LargeLogDiscarding) {
|
| MetricsLogManager log_manager(&pref_service, 1);
|
| log_manager.LoadPersistedUnsentLogs();
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service)));
|
| log_manager.FinishCurrentLog();
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::ONGOING_LOG, &client, &pref_service)));
|
| log_manager.FinishCurrentLog();
|
|
|
| @@ -288,10 +289,10 @@ TEST(MetricsLogManagerTest, DiscardOrder) {
|
| MetricsLogManager log_manager(&pref_service, 0);
|
| log_manager.LoadPersistedUnsentLogs();
|
|
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::INITIAL_STABILITY_LOG, &client, &pref_service)));
|
| log_manager.FinishCurrentLog();
|
| - log_manager.BeginLoggingWithLog(make_scoped_ptr(new MetricsLog(
|
| + log_manager.BeginLoggingWithLog(base::WrapUnique(new MetricsLog(
|
| "id", 0, MetricsLog::ONGOING_LOG, &client, &pref_service)));
|
| log_manager.StageNextLogForUpload();
|
| log_manager.FinishCurrentLog();
|
|
|