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

Unified Diff: base/containers/scoped_ptr_map_unittest.cc

Issue 1480773002: base: Make ScopedPtrMap use DISALLOW_COPY_AND_ASSIGN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move-only-1: dontchangetype Created 5 years, 1 month 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 | « base/containers/scoped_ptr_map.h ('k') | sync/engine/commit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/scoped_ptr_map_unittest.cc
diff --git a/base/containers/scoped_ptr_map_unittest.cc b/base/containers/scoped_ptr_map_unittest.cc
index 6f867a91498d60318ee65c948ffac619f4d592e6..f8a9779f3dc062a5e132831338ae194b61b122cd 100644
--- a/base/containers/scoped_ptr_map_unittest.cc
+++ b/base/containers/scoped_ptr_map_unittest.cc
@@ -232,34 +232,6 @@ TEST(ScopedPtrMapTest, MoveAssign) {
EXPECT_TRUE(destroyed);
}
-template <typename Key, typename ScopedPtr>
-ScopedPtrMap<Key, ScopedPtr> PassThru(ScopedPtrMap<Key, ScopedPtr> scoper) {
- return scoper;
-}
-
-TEST(ScopedPtrMapTest, Passed) {
- bool destroyed = false;
- ScopedPtrMap<int, scoped_ptr<ScopedDestroyer>> scoped_map;
- ScopedDestroyer* elem = new ScopedDestroyer(&destroyed);
- scoped_map.insert(0, make_scoped_ptr(elem));
- EXPECT_EQ(elem, scoped_map.find(0)->second);
- EXPECT_FALSE(destroyed);
-
- base::Callback<ScopedPtrMap<int, scoped_ptr<ScopedDestroyer>>(void)>
- callback = base::Bind(&PassThru<int, scoped_ptr<ScopedDestroyer>>,
- base::Passed(&scoped_map));
- EXPECT_TRUE(scoped_map.empty());
- EXPECT_FALSE(destroyed);
-
- ScopedPtrMap<int, scoped_ptr<ScopedDestroyer>> result = callback.Run();
- EXPECT_TRUE(scoped_map.empty());
- EXPECT_EQ(elem, result.find(0)->second);
- EXPECT_FALSE(destroyed);
-
- result.clear();
- EXPECT_TRUE(destroyed);
-};
-
// Test that using a value type from a namespace containing an ignore_result
// function compiles correctly.
TEST(ScopedPtrMapTest, IgnoreResultCompile) {
« no previous file with comments | « base/containers/scoped_ptr_map.h ('k') | sync/engine/commit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698