| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 virtual void SetUp() { | 259 virtual void SetUp() { |
| 260 base::Thread::Options options; | 260 base::Thread::Options options; |
| 261 options.message_loop_type = MessageLoop::TYPE_IO; | 261 options.message_loop_type = MessageLoop::TYPE_IO; |
| 262 ASSERT_TRUE(io_thread_.StartWithOptions(options)); | 262 ASSERT_TRUE(io_thread_.StartWithOptions(options)); |
| 263 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 263 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 264 ASSERT_TRUE(MockLaunchd::MakeABundle(GetTempDirPath(), | 264 ASSERT_TRUE(MockLaunchd::MakeABundle(GetTempDirPath(), |
| 265 "Test", | 265 "Test", |
| 266 &bundle_path_, | 266 &bundle_path_, |
| 267 &executable_path_)); | 267 &executable_path_)); |
| 268 mock_launchd_.reset(new MockLaunchd(executable_path_, &loop_)); | 268 mock_launchd_.reset(new MockLaunchd(executable_path_, &loop_, |
| 269 false, false)); |
| 269 scoped_launchd_instance_.reset( | 270 scoped_launchd_instance_.reset( |
| 270 new Launchd::ScopedInstance(mock_launchd_.get())); | 271 new Launchd::ScopedInstance(mock_launchd_.get())); |
| 271 ASSERT_TRUE(service_process_state_.Initialize()); | 272 ASSERT_TRUE(service_process_state_.Initialize()); |
| 272 ASSERT_TRUE(service_process_state_.SignalReady( | 273 ASSERT_TRUE(service_process_state_.SignalReady( |
| 273 io_thread_.message_loop_proxy(), | 274 io_thread_.message_loop_proxy(), |
| 274 base::Closure())); | 275 base::Closure())); |
| 275 loop_.PostDelayedTask(FROM_HERE, | 276 loop_.PostDelayedTask(FROM_HERE, |
| 276 MessageLoop::QuitClosure(), | 277 MessageLoop::QuitClosure(), |
| 277 TestTimeouts::action_max_timeout_ms()); | 278 TestTimeouts::action_max_timeout_ms()); |
| 278 } | 279 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 409 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
| 409 GetIOMessageLoopProxy()->PostTask( | 410 GetIOMessageLoopProxy()->PostTask( |
| 410 FROM_HERE, | 411 FROM_HERE, |
| 411 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 412 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
| 412 Run(); | 413 Run(); |
| 413 ASSERT_TRUE(mock_launchd()->remove_called()); | 414 ASSERT_TRUE(mock_launchd()->remove_called()); |
| 414 ASSERT_TRUE(mock_launchd()->delete_called()); | 415 ASSERT_TRUE(mock_launchd()->delete_called()); |
| 415 } | 416 } |
| 416 | 417 |
| 417 #endif // !OS_MACOSX | 418 #endif // !OS_MACOSX |
| OLD | NEW |