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

Unified Diff: components/sync/syncable/parent_child_index_unittest.cc

Issue 2292393004: Remove stl_util from sync. (Closed)
Patch Set: rebase Created 4 years, 3 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/sync/syncable/parent_child_index_unittest.cc
diff --git a/components/sync/syncable/parent_child_index_unittest.cc b/components/sync/syncable/parent_child_index_unittest.cc
index 8119c377660c66f56fc8a83a30c6ba27198c7bd5..1ac7ca79a4dbd825d7ff76a16a0f51e4d15251a0 100644
--- a/components/sync/syncable/parent_child_index_unittest.cc
+++ b/components/sync/syncable/parent_child_index_unittest.cc
@@ -4,10 +4,10 @@
#include "components/sync/syncable/parent_child_index.h"
-#include <list>
#include <string>
+#include <vector>
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "components/sync/syncable/entry_kernel.h"
#include "components/sync/syncable/syncable_util.h"
@@ -24,11 +24,7 @@ static const std::string kCacheGuid = "8HhNIHlEOCGQbIAALr9QEg==";
class ParentChildIndexTest : public testing::Test {
public:
- void TearDown() override {
- // To make memory management easier, we take ownership of all EntryKernels
- // returned by our factory methods and delete them here.
- base::STLDeleteElements(&owned_entry_kernels_);
- }
+ void TearDown() override {}
// Unfortunately, we can't use the regular Entry factory methods, because the
// ParentChildIndex deals in EntryKernels.
@@ -55,7 +51,7 @@ class ParentChildIndexTest : public testing::Test {
root->put(ID, syncable::Id::GetRoot());
root->put(PARENT_ID, syncable::Id::GetRoot());
- owned_entry_kernels_.push_back(root);
+ owned_entry_kernels_.push_back(base::WrapUnique(root));
return root;
}
@@ -75,7 +71,7 @@ class ParentChildIndexTest : public testing::Test {
AddDefaultFieldValue(model_type, &specifics);
folder->put(SPECIFICS, specifics);
- owned_entry_kernels_.push_back(folder);
+ owned_entry_kernels_.push_back(base::WrapUnique(folder));
return folder;
}
@@ -101,7 +97,7 @@ class ParentChildIndexTest : public testing::Test {
bm->put(UNIQUE_POSITION, unique_pos);
bm->put(SERVER_UNIQUE_POSITION, unique_pos);
- owned_entry_kernels_.push_back(bm);
+ owned_entry_kernels_.push_back(base::WrapUnique(bm));
return bm;
}
@@ -127,7 +123,7 @@ class ParentChildIndexTest : public testing::Test {
item->put(SPECIFICS, specifics);
}
- owned_entry_kernels_.push_back(item);
+ owned_entry_kernels_.push_back(base::WrapUnique(item));
return item;
}
@@ -146,7 +142,7 @@ class ParentChildIndexTest : public testing::Test {
ParentChildIndex index_;
private:
- std::list<EntryKernel*> owned_entry_kernels_;
+ std::vector<std::unique_ptr<EntryKernel>> owned_entry_kernels_;
};
TEST_F(ParentChildIndexTest, TestRootNode) {

Powered by Google App Engine
This is Rietveld 408576698