| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/process_util.h" | 5 #include "base/process_util.h" |
| 6 #include "base/test/test_timeouts.h" | 6 #include "base/test/test_timeouts.h" |
| 7 #include "chrome/browser/service/service_process_control.h" | 7 #include "chrome/browser/service/service_process_control.h" |
| 8 #include "chrome/browser/service/service_process_control_manager.h" | 8 #include "chrome/browser/service/service_process_control_manager.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void Disconnect() { | 67 void Disconnect() { |
| 68 // This will delete all instances of ServiceProcessControl and close the IPC | 68 // This will delete all instances of ServiceProcessControl and close the IPC |
| 69 // connections. | 69 // connections. |
| 70 ServiceProcessControlManager::GetInstance()->Shutdown(); | 70 ServiceProcessControlManager::GetInstance()->Shutdown(); |
| 71 process_ = NULL; | 71 process_ = NULL; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void WaitForShutdown() { | 74 void WaitForShutdown() { |
| 75 EXPECT_TRUE(base::WaitForSingleProcess( | 75 EXPECT_TRUE(base::WaitForSingleProcess( |
| 76 service_process_handle_, | 76 service_process_handle_, |
| 77 TestTimeouts::wait_for_terminate_timeout_ms())); | 77 TestTimeouts::action_max_timeout_ms())); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void ProcessControlLaunched() { | 80 void ProcessControlLaunched() { |
| 81 base::ProcessId service_pid; | 81 base::ProcessId service_pid; |
| 82 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid)); | 82 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid)); |
| 83 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); | 83 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); |
| 84 EXPECT_TRUE(base::OpenProcessHandleWithAccess( | 84 EXPECT_TRUE(base::OpenProcessHandleWithAccess( |
| 85 service_pid, | 85 service_pid, |
| 86 base::kProcessAccessWaitForTermination, | 86 base::kProcessAccessWaitForTermination, |
| 87 &service_process_handle_)); | 87 &service_process_handle_)); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, MAYBE_CheckPid) { | 243 IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, MAYBE_CheckPid) { |
| 244 base::ProcessId service_pid; | 244 base::ProcessId service_pid; |
| 245 EXPECT_FALSE(GetServiceProcessData(NULL, &service_pid)); | 245 EXPECT_FALSE(GetServiceProcessData(NULL, &service_pid)); |
| 246 // Launch the service process. | 246 // Launch the service process. |
| 247 LaunchServiceProcessControl(); | 247 LaunchServiceProcessControl(); |
| 248 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid)); | 248 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid)); |
| 249 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); | 249 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); |
| 250 } | 250 } |
| 251 | 251 |
| 252 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); | 252 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); |
| OLD | NEW |