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

Unified Diff: components/dom_distiller/core/dom_distiller_store_unittest.cc

Issue 1879613003: Convert //components/dom_distiller 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
Index: components/dom_distiller/core/dom_distiller_store_unittest.cc
diff --git a/components/dom_distiller/core/dom_distiller_store_unittest.cc b/components/dom_distiller/core/dom_distiller_store_unittest.cc
index c962aa4f5f57d78a730efd10c3a1704315923d3a..15b3452dad71362493db87dd218708129481fa47 100644
--- a/components/dom_distiller/core/dom_distiller_store_unittest.cc
+++ b/components/dom_distiller/core/dom_distiller_store_unittest.cc
@@ -5,11 +5,13 @@
#include "components/dom_distiller/core/dom_distiller_store.h"
#include <stdint.h>
+
#include <utility>
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/time/time.h"
@@ -154,8 +156,8 @@ class DomDistillerStoreTest : public testing::Test {
store_->MergeDataAndStartSyncing(
kDomDistillerModelType, SyncDataFromEntryMap(sync_model_),
- make_scoped_ptr<SyncChangeProcessor>(fake_sync_processor_),
- scoped_ptr<SyncErrorFactory>(new FakeSyncErrorFactory()));
+ base::WrapUnique<SyncChangeProcessor>(fake_sync_processor_),
+ std::unique_ptr<SyncErrorFactory>(new FakeSyncErrorFactory()));
}
protected:
@@ -181,7 +183,7 @@ class DomDistillerStoreTest : public testing::Test {
EntryMap sync_model_;
FakeDB<ArticleEntry>::EntryMap store_model_;
- scoped_ptr<DomDistillerStore> store_;
+ std::unique_ptr<DomDistillerStore> store_;
// Both owned by |store_|.
FakeDB<ArticleEntry>* fake_db_;
@@ -316,7 +318,8 @@ class MockAttachmentsCallbacks {
MOCK_METHOD2(Get, void(bool, ArticleAttachmentsData*));
MOCK_METHOD1(Update, void(bool));
- void GetImpl(bool success, scoped_ptr<ArticleAttachmentsData> attachments) {
+ void GetImpl(bool success,
+ std::unique_ptr<ArticleAttachmentsData> attachments) {
Get(success, attachments.get());
}
@@ -351,7 +354,7 @@ TEST_F(DomDistillerStoreTest, TestAttachments) {
attachments.set_distilled_article(article_proto);
store_->UpdateAttachments(
entry.entry_id(),
- make_scoped_ptr(new ArticleAttachmentsData(attachments)),
+ base::WrapUnique(new ArticleAttachmentsData(attachments)),
callbacks.UpdateCallback());
EXPECT_CALL(callbacks, Update(true));
base::RunLoop().RunUntilIdle();
@@ -509,8 +512,9 @@ TEST_F(DomDistillerStoreTest, TestSyncMergeWithSecondDomDistillerStore) {
FakeDB<ArticleEntry>* other_fake_db =
new FakeDB<ArticleEntry>(&other_db_model);
- scoped_ptr<DomDistillerStore> owned_other_store(new DomDistillerStore(
- scoped_ptr<leveldb_proto::ProtoDatabase<ArticleEntry> >(other_fake_db),
+ std::unique_ptr<DomDistillerStore> owned_other_store(new DomDistillerStore(
+ std::unique_ptr<leveldb_proto::ProtoDatabase<ArticleEntry>>(
+ other_fake_db),
std::vector<ArticleEntry>(),
base::FilePath(FILE_PATH_LITERAL("/fake/other/path"))));
DomDistillerStore* other_store = owned_other_store.get();
@@ -525,7 +529,7 @@ TEST_F(DomDistillerStoreTest, TestSyncMergeWithSecondDomDistillerStore) {
store_->MergeDataAndStartSyncing(
kDomDistillerModelType, SyncDataFromEntryMap(other_db_model),
std::move(owned_other_store),
- make_scoped_ptr<SyncErrorFactory>(other_error_factory));
+ base::WrapUnique<SyncErrorFactory>(other_error_factory));
EXPECT_TRUE(AreEntriesEqual(store_->GetEntries(), expected_model));
EXPECT_TRUE(AreEntriesEqual(other_store->GetEntries(), expected_model));
@@ -585,8 +589,8 @@ TEST_F(DomDistillerStoreTest, TestObserver) {
new FakeSyncChangeProcessor(&fake_model);
store_->MergeDataAndStartSyncing(
kDomDistillerModelType, change_data,
- make_scoped_ptr<SyncChangeProcessor>(fake_sync_change_processor),
- make_scoped_ptr<SyncErrorFactory>(fake_error_factory));
+ base::WrapUnique<SyncChangeProcessor>(fake_sync_change_processor),
+ base::WrapUnique<SyncErrorFactory>(fake_error_factory));
}
} // namespace dom_distiller
« no previous file with comments | « components/dom_distiller/core/dom_distiller_store.cc ('k') | components/dom_distiller/core/dom_distiller_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698