| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 "Test", | 276 "Test", |
| 277 &bundle_path_, | 277 &bundle_path_, |
| 278 &executable_path_)); | 278 &executable_path_)); |
| 279 mock_launchd_.reset(new MockLaunchd(executable_path_, &loop_, | 279 mock_launchd_.reset(new MockLaunchd(executable_path_, &loop_, |
| 280 false, false)); | 280 false, false)); |
| 281 scoped_launchd_instance_.reset( | 281 scoped_launchd_instance_.reset( |
| 282 new Launchd::ScopedInstance(mock_launchd_.get())); | 282 new Launchd::ScopedInstance(mock_launchd_.get())); |
| 283 ASSERT_TRUE(service_process_state_.Initialize()); | 283 ASSERT_TRUE(service_process_state_.Initialize()); |
| 284 ASSERT_TRUE(service_process_state_.SignalReady( | 284 ASSERT_TRUE(service_process_state_.SignalReady( |
| 285 io_thread_.task_runner().get(), base::Closure())); | 285 io_thread_.task_runner().get(), base::Closure())); |
| 286 loop_.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), | 286 loop_.task_runner()->PostDelayedTask( |
| 287 TestTimeouts::action_max_timeout()); | 287 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
| 288 TestTimeouts::action_max_timeout()); |
| 288 } | 289 } |
| 289 | 290 |
| 290 const MockLaunchd* mock_launchd() const { return mock_launchd_.get(); } | 291 const MockLaunchd* mock_launchd() const { return mock_launchd_.get(); } |
| 291 const base::FilePath& executable_path() const { return executable_path_; } | 292 const base::FilePath& executable_path() const { return executable_path_; } |
| 292 const base::FilePath& bundle_path() const { return bundle_path_; } | 293 const base::FilePath& bundle_path() const { return bundle_path_; } |
| 293 const base::FilePath& GetTempDirPath() const { return temp_dir_.path(); } | 294 const base::FilePath& GetTempDirPath() const { return temp_dir_.path(); } |
| 294 | 295 |
| 295 base::SingleThreadTaskRunner* GetIOMessageLoopProxy() { | 296 base::SingleThreadTaskRunner* GetIOMessageLoopProxy() { |
| 296 return io_thread_.task_runner().get(); | 297 return io_thread_.task_runner().get(); |
| 297 } | 298 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 422 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
| 422 GetIOMessageLoopProxy()->PostTask( | 423 GetIOMessageLoopProxy()->PostTask( |
| 423 FROM_HERE, | 424 FROM_HERE, |
| 424 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 425 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
| 425 Run(); | 426 Run(); |
| 426 ASSERT_TRUE(mock_launchd()->remove_called()); | 427 ASSERT_TRUE(mock_launchd()->remove_called()); |
| 427 ASSERT_TRUE(mock_launchd()->delete_called()); | 428 ASSERT_TRUE(mock_launchd()->delete_called()); |
| 428 } | 429 } |
| 429 | 430 |
| 430 #endif // !OS_MACOSX | 431 #endif // !OS_MACOSX |
| OLD | NEW |