| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Note: This file also tests child_process.*. | 5 // Note: This file also tests child_process.*. |
| 6 | 6 |
| 7 #include "services/service_manager/runner/host/child_process_host.h" | 7 #include "services/service_manager/runner/host/child_process_host.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 base::CommandLine* command_line) override { | 59 base::CommandLine* command_line) override { |
| 60 adjust_count_++; | 60 adjust_count_++; |
| 61 } | 61 } |
| 62 | 62 |
| 63 size_t adjust_count_ = 0; | 63 size_t adjust_count_ = 0; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(NativeRunnerDelegateImpl); | 65 DISALLOW_COPY_AND_ASSIGN(NativeRunnerDelegateImpl); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 #if defined(OS_ANDROID) | 68 #if defined(OS_ANDROID) |
| 69 // TODO(qsr): Multiprocess shell tests are not supported on android. | 69 // TODO(qsr): Multiprocess service manager tests are not supported on android. |
| 70 #define MAYBE_StartJoin DISABLED_StartJoin | 70 #define MAYBE_StartJoin DISABLED_StartJoin |
| 71 #else | 71 #else |
| 72 #define MAYBE_StartJoin StartJoin | 72 #define MAYBE_StartJoin StartJoin |
| 73 #endif // defined(OS_ANDROID) | 73 #endif // defined(OS_ANDROID) |
| 74 // Just tests starting the child process and joining it (without starting an | 74 // Just tests starting the child process and joining it (without starting an |
| 75 // app). | 75 // app). |
| 76 TEST(ChildProcessHostTest, MAYBE_StartJoin) { | 76 TEST(ChildProcessHostTest, MAYBE_StartJoin) { |
| 77 base::FilePath shell_dir; | 77 base::FilePath service_manager_dir; |
| 78 PathService::Get(base::DIR_MODULE, &shell_dir); | 78 PathService::Get(base::DIR_MODULE, &service_manager_dir); |
| 79 base::MessageLoop message_loop; | 79 base::MessageLoop message_loop; |
| 80 scoped_refptr<base::SequencedWorkerPool> blocking_pool( | 80 scoped_refptr<base::SequencedWorkerPool> blocking_pool( |
| 81 new base::SequencedWorkerPool(3, "blocking_pool", | 81 new base::SequencedWorkerPool(3, "blocking_pool", |
| 82 base::TaskPriority::USER_VISIBLE)); | 82 base::TaskPriority::USER_VISIBLE)); |
| 83 | 83 |
| 84 base::Thread io_thread("io_thread"); | 84 base::Thread io_thread("io_thread"); |
| 85 base::Thread::Options options; | 85 base::Thread::Options options; |
| 86 options.message_loop_type = base::MessageLoop::TYPE_IO; | 86 options.message_loop_type = base::MessageLoop::TYPE_IO; |
| 87 io_thread.StartWithOptions(options); | 87 io_thread.StartWithOptions(options); |
| 88 | 88 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 101 run_loop.Run(); | 101 run_loop.Run(); |
| 102 | 102 |
| 103 child_process_host.Join(); | 103 child_process_host.Join(); |
| 104 blocking_pool->Shutdown(); | 104 blocking_pool->Shutdown(); |
| 105 mojo::edk::ShutdownIPCSupport(); | 105 mojo::edk::ShutdownIPCSupport(); |
| 106 EXPECT_EQ(1u, native_runner_delegate.get_and_clear_adjust_count()); | 106 EXPECT_EQ(1u, native_runner_delegate.get_and_clear_adjust_count()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace | 109 } // namespace |
| 110 } // namespace service_manager | 110 } // namespace service_manager |
| OLD | NEW |