| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |