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/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 scoped_ptr<MockLaunchd> mock_launchd_; | 295 scoped_ptr<MockLaunchd> mock_launchd_; |
296 scoped_ptr<Launchd::ScopedInstance> scoped_launchd_instance_; | 296 scoped_ptr<Launchd::ScopedInstance> scoped_launchd_instance_; |
297 ServiceProcessState service_process_state_; | 297 ServiceProcessState service_process_state_; |
298 }; | 298 }; |
299 | 299 |
300 void DeleteFunc(const base::FilePath& file) { | 300 void DeleteFunc(const base::FilePath& file) { |
301 EXPECT_TRUE(base::Delete(file, true)); | 301 EXPECT_TRUE(base::Delete(file, true)); |
302 } | 302 } |
303 | 303 |
304 void MoveFunc(const base::FilePath& from, const base::FilePath& to) { | 304 void MoveFunc(const base::FilePath& from, const base::FilePath& to) { |
305 EXPECT_TRUE(file_util::Move(from, to)); | 305 EXPECT_TRUE(base::Move(from, to)); |
306 } | 306 } |
307 | 307 |
308 void ChangeAttr(const base::FilePath& from, int mode) { | 308 void ChangeAttr(const base::FilePath& from, int mode) { |
309 EXPECT_EQ(chmod(from.value().c_str(), mode), 0); | 309 EXPECT_EQ(chmod(from.value().c_str(), mode), 0); |
310 } | 310 } |
311 | 311 |
312 class ScopedAttributesRestorer { | 312 class ScopedAttributesRestorer { |
313 public: | 313 public: |
314 ScopedAttributesRestorer(const base::FilePath& path, int mode) | 314 ScopedAttributesRestorer(const base::FilePath& path, int mode) |
315 : path_(path), mode_(mode) { | 315 : path_(path), mode_(mode) { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 408 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
409 GetIOMessageLoopProxy()->PostTask( | 409 GetIOMessageLoopProxy()->PostTask( |
410 FROM_HERE, | 410 FROM_HERE, |
411 base::Bind(&ChangeAttr, bundle_path(), 0222)); | 411 base::Bind(&ChangeAttr, bundle_path(), 0222)); |
412 Run(); | 412 Run(); |
413 ASSERT_TRUE(mock_launchd()->remove_called()); | 413 ASSERT_TRUE(mock_launchd()->remove_called()); |
414 ASSERT_TRUE(mock_launchd()->delete_called()); | 414 ASSERT_TRUE(mock_launchd()->delete_called()); |
415 } | 415 } |
416 | 416 |
417 #endif // !OS_MACOSX | 417 #endif // !OS_MACOSX |
OLD | NEW |