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

Side by Side Diff: services/shell/background/tests/background_shell_unittest.cc

Issue 2259823003: 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
« no previous file with comments | « services/file/file_service.cc ('k') | services/shell/public/cpp/interface_registry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/shell/background/background_shell.h" 5 #include "services/shell/background/background_shell.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 14 matching lines...) Expand all
25 ServiceImpl() {} 25 ServiceImpl() {}
26 ~ServiceImpl() override {} 26 ~ServiceImpl() override {}
27 27
28 private: 28 private:
29 DISALLOW_COPY_AND_ASSIGN(ServiceImpl); 29 DISALLOW_COPY_AND_ASSIGN(ServiceImpl);
30 }; 30 };
31 31
32 std::unique_ptr<TestCatalogStore> BuildTestCatalogStore() { 32 std::unique_ptr<TestCatalogStore> BuildTestCatalogStore() {
33 std::unique_ptr<base::ListValue> apps(new base::ListValue); 33 std::unique_ptr<base::ListValue> apps(new base::ListValue);
34 apps->Append(BuildPermissiveSerializedAppInfo(kTestName, "test")); 34 apps->Append(BuildPermissiveSerializedAppInfo(kTestName, "test"));
35 return base::WrapUnique(new TestCatalogStore(std::move(apps))); 35 return base::MakeUnique<TestCatalogStore>(std::move(apps));
36 } 36 }
37 37
38 void SetFlagAndRunClosure(bool* flag, const base::Closure& closure) { 38 void SetFlagAndRunClosure(bool* flag, const base::Closure& closure) {
39 *flag = true; 39 *flag = true;
40 closure.Run(); 40 closure.Run();
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
45 // Uses BackgroundShell to start the shell in the background and connects to 45 // Uses BackgroundShell to start the shell in the background and connects to
(...skipping 24 matching lines...) Expand all
70 base::RunLoop run_loop; 70 base::RunLoop run_loop;
71 bool got_result = false; 71 bool got_result = false;
72 test_service->Test(base::Bind(&SetFlagAndRunClosure, &got_result, 72 test_service->Test(base::Bind(&SetFlagAndRunClosure, &got_result,
73 run_loop.QuitClosure())); 73 run_loop.QuitClosure()));
74 run_loop.Run(); 74 run_loop.Run();
75 EXPECT_TRUE(got_result); 75 EXPECT_TRUE(got_result);
76 EXPECT_TRUE(store->get_store_called()); 76 EXPECT_TRUE(store->get_store_called());
77 } 77 }
78 78
79 } // namespace shell 79 } // namespace shell
OLDNEW
« no previous file with comments | « services/file/file_service.cc ('k') | services/shell/public/cpp/interface_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698