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

Side by Side Diff: chrome/browser/chromeos/policy/extension_cache_unittest.cc

Issue 2257103002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 CreateExtensionFile(cache_path, kTestExtensionId1, "1.0", kExtensionSize1, 79 CreateExtensionFile(cache_path, kTestExtensionId1, "1.0", kExtensionSize1,
80 now - base::TimeDelta::FromSeconds(1)); 80 now - base::TimeDelta::FromSeconds(1));
81 const base::FilePath file2 = 81 const base::FilePath file2 =
82 CreateExtensionFile(cache_path, kTestExtensionId2, "2.0", kExtensionSize2, 82 CreateExtensionFile(cache_path, kTestExtensionId2, "2.0", kExtensionSize2,
83 now - base::TimeDelta::FromSeconds(2)); 83 now - base::TimeDelta::FromSeconds(2));
84 const base::FilePath file3 = 84 const base::FilePath file3 =
85 CreateExtensionFile(cache_path, kTestExtensionId3, "3.0", kExtensionSize3, 85 CreateExtensionFile(cache_path, kTestExtensionId3, "3.0", kExtensionSize3,
86 now - base::TimeDelta::FromSeconds(3)); 86 now - base::TimeDelta::FromSeconds(3));
87 87
88 ExtensionCacheImpl cache_impl( 88 ExtensionCacheImpl cache_impl(
89 base::WrapUnique(new ChromeOSExtensionCacheDelegate(cache_path))); 89 base::MakeUnique<ChromeOSExtensionCacheDelegate>(cache_path));
90 90
91 std::unique_ptr<base::RunLoop> run_loop(new base::RunLoop); 91 std::unique_ptr<base::RunLoop> run_loop(new base::RunLoop);
92 cache_impl.Start(run_loop->QuitClosure()); 92 cache_impl.Start(run_loop->QuitClosure());
93 run_loop->Run(); 93 run_loop->Run();
94 94
95 run_loop.reset(new base::RunLoop); 95 run_loop.reset(new base::RunLoop);
96 cache_impl.Shutdown(run_loop->QuitClosure()); 96 cache_impl.Shutdown(run_loop->QuitClosure());
97 run_loop->Run(); 97 run_loop->Run();
98 98
99 EXPECT_TRUE(base::PathExists(file1)); 99 EXPECT_TRUE(base::PathExists(file1));
100 EXPECT_TRUE(base::PathExists(file2)); 100 EXPECT_TRUE(base::PathExists(file2));
101 EXPECT_FALSE(base::PathExists(file3)); 101 EXPECT_FALSE(base::PathExists(file3));
102 } 102 }
103 103
104 } // namespace extensions 104 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698