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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_.task_runner()->PostDelayedTask(FROM_HERE, | 286 loop_.task_runner()->PostDelayedTask(FROM_HERE, |
287 run_loop_.QuitWhenIdleClosure(), | 287 run_loop_.QuitWhenIdleClosure(), |
288 TestTimeouts::action_max_timeout()); | 288 TestTimeouts::action_max_timeout()); |
289 } | 289 } |
290 | 290 |
291 const MockLaunchd* mock_launchd() const { return mock_launchd_.get(); } | 291 const MockLaunchd* mock_launchd() const { return mock_launchd_.get(); } |
292 const base::FilePath& executable_path() const { return executable_path_; } | 292 const base::FilePath& executable_path() const { return executable_path_; } |
293 const base::FilePath& bundle_path() const { return bundle_path_; } | 293 const base::FilePath& bundle_path() const { return bundle_path_; } |
294 const base::FilePath& GetTempDirPath() const { return temp_dir_.path(); } | 294 const base::FilePath& GetTempDirPath() const { return temp_dir_.GetPath(); } |
295 | 295 |
296 base::SingleThreadTaskRunner* GetIOTaskRunner() { | 296 base::SingleThreadTaskRunner* GetIOTaskRunner() { |
297 return io_thread_.task_runner().get(); | 297 return io_thread_.task_runner().get(); |
298 } | 298 } |
299 void Run() { run_loop_.Run(); } | 299 void Run() { run_loop_.Run(); } |
300 | 300 |
301 private: | 301 private: |
302 base::ScopedTempDir temp_dir_; | 302 base::ScopedTempDir temp_dir_; |
303 base::MessageLoopForUI loop_; | 303 base::MessageLoopForUI loop_; |
304 base::RunLoop run_loop_; | 304 base::RunLoop run_loop_; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 TEST_F(ServiceProcessStateFileManipulationTest, ChangeAttr) { | 416 TEST_F(ServiceProcessStateFileManipulationTest, ChangeAttr) { |
417 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 417 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
418 GetIOTaskRunner()->PostTask(FROM_HERE, | 418 GetIOTaskRunner()->PostTask(FROM_HERE, |
419 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 419 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
420 Run(); | 420 Run(); |
421 ASSERT_TRUE(mock_launchd()->remove_called()); | 421 ASSERT_TRUE(mock_launchd()->remove_called()); |
422 ASSERT_TRUE(mock_launchd()->delete_called()); | 422 ASSERT_TRUE(mock_launchd()->delete_called()); |
423 } | 423 } |
424 | 424 |
425 #endif // !OS_MACOSX | 425 #endif // !OS_MACOSX |
OLD | NEW |