| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
| 9 #if !defined(OS_MACOSX) | 9 #if !defined(OS_MACOSX) |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 #include "base/file_path.h" | 243 #include "base/file_path.h" |
| 244 #include "base/file_util.h" | 244 #include "base/file_util.h" |
| 245 #include "base/mac/mac_util.h" | 245 #include "base/mac/mac_util.h" |
| 246 #include "base/mac/scoped_cftyperef.h" | 246 #include "base/mac/scoped_cftyperef.h" |
| 247 #include "base/message_loop.h" | 247 #include "base/message_loop.h" |
| 248 #include "base/scoped_temp_dir.h" | 248 #include "base/scoped_temp_dir.h" |
| 249 #include "base/stringprintf.h" | 249 #include "base/stringprintf.h" |
| 250 #include "base/sys_string_conversions.h" | 250 #include "base/sys_string_conversions.h" |
| 251 #include "base/test/test_timeouts.h" | 251 #include "base/test/test_timeouts.h" |
| 252 #include "base/threading/thread.h" | 252 #include "base/threading/thread.h" |
| 253 #include "chrome/common/launchd_mac.h" | 253 #include "chrome/common/mac/launchd.h" |
| 254 #include "testing/gtest/include/gtest/gtest.h" | 254 #include "testing/gtest/include/gtest/gtest.h" |
| 255 | 255 |
| 256 // TODO(dmaclach): Write this in terms of a real mock. | 256 // TODO(dmaclach): Write this in terms of a real mock. |
| 257 // http://crbug.com/76923 | 257 // http://crbug.com/76923 |
| 258 class MockLaunchd : public Launchd { | 258 class MockLaunchd : public Launchd { |
| 259 public: | 259 public: |
| 260 MockLaunchd(const FilePath& file, MessageLoop* loop) | 260 MockLaunchd(const FilePath& file, MessageLoop* loop) |
| 261 : file_(file), | 261 : file_(file), |
| 262 message_loop_(loop), | 262 message_loop_(loop), |
| 263 restart_called_(false), | 263 restart_called_(false), |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 553 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
| 554 GetIOMessageLoopProxy()->PostTask( | 554 GetIOMessageLoopProxy()->PostTask( |
| 555 FROM_HERE, | 555 FROM_HERE, |
| 556 NewRunnableFunction(&ChangeAttr, bundle_path(), 0222)); | 556 NewRunnableFunction(&ChangeAttr, bundle_path(), 0222)); |
| 557 Run(); | 557 Run(); |
| 558 ASSERT_TRUE(mock_launchd()->remove_called()); | 558 ASSERT_TRUE(mock_launchd()->remove_called()); |
| 559 ASSERT_TRUE(mock_launchd()->delete_called()); | 559 ASSERT_TRUE(mock_launchd()->delete_called()); |
| 560 } | 560 } |
| 561 | 561 |
| 562 #endif // !OS_MACOSX | 562 #endif // !OS_MACOSX |
| OLD | NEW |