| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/common/service_process_util.h" | 5 #include "chrome/common/service_process_util.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 for (int i = 0; !CheckServiceProcessReady() && i < 10; ++i) { | 187 for (int i = 0; !CheckServiceProcessReady() && i < 10; ++i) { |
| 188 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout()); | 188 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout()); |
| 189 } | 189 } |
| 190 ASSERT_TRUE(CheckServiceProcessReady()); | 190 ASSERT_TRUE(CheckServiceProcessReady()); |
| 191 std::string version; | 191 std::string version; |
| 192 base::ProcessId pid; | 192 base::ProcessId pid; |
| 193 ASSERT_TRUE(GetServiceProcessData(&version, &pid)); | 193 ASSERT_TRUE(GetServiceProcessData(&version, &pid)); |
| 194 ASSERT_TRUE(ForceServiceProcessShutdown(version, pid)); | 194 ASSERT_TRUE(ForceServiceProcessShutdown(version, pid)); |
| 195 int exit_code = 0; | 195 int exit_code = 0; |
| 196 ASSERT_TRUE(base::WaitForExitCodeWithTimeout(handle, | 196 ASSERT_TRUE(base::WaitForExitCodeWithTimeout(handle, |
| 197 &exit_code, TestTimeouts::action_max_timeout_ms())); | 197 &exit_code, TestTimeouts::action_max_timeout())); |
| 198 base::CloseProcessHandle(handle); | 198 base::CloseProcessHandle(handle); |
| 199 ASSERT_EQ(exit_code, 0); | 199 ASSERT_EQ(exit_code, 0); |
| 200 } | 200 } |
| 201 | 201 |
| 202 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestSingleton) { | 202 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestSingleton) { |
| 203 ServiceProcessState state; | 203 ServiceProcessState state; |
| 204 EXPECT_FALSE(state.Initialize()); | 204 EXPECT_FALSE(state.Initialize()); |
| 205 return 0; | 205 return 0; |
| 206 } | 206 } |
| 207 | 207 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 409 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
| 410 GetIOMessageLoopProxy()->PostTask( | 410 GetIOMessageLoopProxy()->PostTask( |
| 411 FROM_HERE, | 411 FROM_HERE, |
| 412 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 412 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
| 413 Run(); | 413 Run(); |
| 414 ASSERT_TRUE(mock_launchd()->remove_called()); | 414 ASSERT_TRUE(mock_launchd()->remove_called()); |
| 415 ASSERT_TRUE(mock_launchd()->delete_called()); | 415 ASSERT_TRUE(mock_launchd()->delete_called()); |
| 416 } | 416 } |
| 417 | 417 |
| 418 #endif // !OS_MACOSX | 418 #endif // !OS_MACOSX |
| OLD | NEW |