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

Side by Side Diff: base/containers/scoped_ptr_map_unittest.cc

Issue 1194373002: Moved ScopedPtrMap into base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@jianli-gcm_client_impl
Patch Set: Rebase and update against media_galleries. Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/containers/scoped_ptr_map.h" 5 #include "base/containers/scoped_ptr_map.h"
6 6
7 #include <functional> 7 #include <functional>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace base {
16 namespace { 17 namespace {
17 18
18 // A ScopedDestroyer sets a Boolean to true upon destruction. 19 // A ScopedDestroyer sets a Boolean to true upon destruction.
19 class ScopedDestroyer { 20 class ScopedDestroyer {
20 public: 21 public:
21 ScopedDestroyer(bool* destroyed) : destroyed_(destroyed) { 22 ScopedDestroyer(bool* destroyed) : destroyed_(destroyed) {
22 *destroyed_ = false; 23 *destroyed_ = false;
23 } 24 }
24 25
25 ~ScopedDestroyer() { *destroyed_ = true; } 26 ~ScopedDestroyer() { *destroyed_ = true; }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 ScopedPtrMap<int, scoped_ptr<ScopedDestroyer>> result = callback.Run(); 230 ScopedPtrMap<int, scoped_ptr<ScopedDestroyer>> result = callback.Run();
230 EXPECT_TRUE(scoped_map.empty()); 231 EXPECT_TRUE(scoped_map.empty());
231 EXPECT_EQ(elem, result.find(0)->second); 232 EXPECT_EQ(elem, result.find(0)->second);
232 EXPECT_FALSE(destroyed); 233 EXPECT_FALSE(destroyed);
233 234
234 result.clear(); 235 result.clear();
235 EXPECT_TRUE(destroyed); 236 EXPECT_TRUE(destroyed);
236 }; 237 };
237 238
238 } // namespace 239 } // namespace
240 } // namespace base
OLDNEW
« no previous file with comments | « base/containers/scoped_ptr_map.h ('k') | chrome/browser/media_galleries/gallery_watch_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698