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

Side by Side Diff: content/browser/storage_partition_impl_map_unittest.cc

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/storage_partition_impl_map.h" 5 #include "content/browser/storage_partition_impl_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Let's enforce that two identical elements obey strict weak ordering. 63 // Let's enforce that two identical elements obey strict weak ordering.
64 EXPECT_TRUE(!less(c1, c2) && !less(c2, c1)); 64 EXPECT_TRUE(!less(c1, c2) && !less(c2, c1));
65 } 65 }
66 66
67 TEST(StoragePartitionImplMapTest, GarbageCollect) { 67 TEST(StoragePartitionImplMapTest, GarbageCollect) {
68 TestBrowserContext browser_context; 68 TestBrowserContext browser_context;
69 base::MessageLoop message_loop; 69 base::MessageLoop message_loop;
70 StoragePartitionImplMap storage_partition_impl_map(&browser_context); 70 StoragePartitionImplMap storage_partition_impl_map(&browser_context);
71 71
72 scoped_ptr<base::hash_set<base::FilePath> > active_paths( 72 std::unique_ptr<base::hash_set<base::FilePath>> active_paths(
73 new base::hash_set<base::FilePath>); 73 new base::hash_set<base::FilePath>);
74 74
75 base::FilePath active_path = browser_context.GetPath().Append( 75 base::FilePath active_path = browser_context.GetPath().Append(
76 StoragePartitionImplMap::GetStoragePartitionPath( 76 StoragePartitionImplMap::GetStoragePartitionPath(
77 "active", std::string())); 77 "active", std::string()));
78 ASSERT_TRUE(base::CreateDirectory(active_path)); 78 ASSERT_TRUE(base::CreateDirectory(active_path));
79 active_paths->insert(active_path); 79 active_paths->insert(active_path);
80 80
81 base::FilePath inactive_path = browser_context.GetPath().Append( 81 base::FilePath inactive_path = browser_context.GetPath().Append(
82 StoragePartitionImplMap::GetStoragePartitionPath( 82 StoragePartitionImplMap::GetStoragePartitionPath(
83 "inactive", std::string())); 83 "inactive", std::string()));
84 ASSERT_TRUE(base::CreateDirectory(inactive_path)); 84 ASSERT_TRUE(base::CreateDirectory(inactive_path));
85 85
86 base::RunLoop run_loop; 86 base::RunLoop run_loop;
87 storage_partition_impl_map.GarbageCollect(std::move(active_paths), 87 storage_partition_impl_map.GarbageCollect(std::move(active_paths),
88 run_loop.QuitClosure()); 88 run_loop.QuitClosure());
89 run_loop.Run(); 89 run_loop.Run();
90 BrowserThread::GetBlockingPool()->FlushForTesting(); 90 BrowserThread::GetBlockingPool()->FlushForTesting();
91 91
92 EXPECT_TRUE(base::PathExists(active_path)); 92 EXPECT_TRUE(base::PathExists(active_path));
93 EXPECT_FALSE(base::PathExists(inactive_path)); 93 EXPECT_FALSE(base::PathExists(inactive_path));
94 } 94 }
95 95
96 } // namespace content 96 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl_map.cc ('k') | content/browser/storage_partition_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698