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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/process_util.h" | 13 #include "base/process_util.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/test/multiprocess_test.h" | 15 #include "base/test/multiprocess_test.h" |
16 #include "base/test/test_timeouts.h" | 16 #include "base/test/test_timeouts.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/chrome_version_info.h" | 20 #include "chrome/common/chrome_version_info.h" |
21 #include "testing/multiprocess_func_list.h" | 21 #include "testing/multiprocess_func_list.h" |
22 | 22 |
23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
24 #include "base/win/win_util.h" | 24 #include "base/win/win_util.h" |
25 #endif | 25 #endif |
26 | 26 |
27 #if defined(OS_LINUX) | 27 #if defined(OS_LINUX) |
| 28 #include "chrome/common/auto_start_linux.h" |
28 #include <glib.h> | 29 #include <glib.h> |
29 #include "chrome/common/auto_start_linux.h" | |
30 #endif | 30 #endif |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 bool g_good_shutdown = false; | 34 bool g_good_shutdown = false; |
35 | 35 |
36 void ShutdownTask(MessageLoop* loop) { | 36 void ShutdownTask(MessageLoop* loop) { |
37 // Quit the main message loop. | 37 // Quit the main message loop. |
38 ASSERT_FALSE(g_good_shutdown); | 38 ASSERT_FALSE(g_good_shutdown); |
39 g_good_shutdown = true; | 39 g_good_shutdown = true; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 #include <CoreFoundation/CoreFoundation.h> | 226 #include <CoreFoundation/CoreFoundation.h> |
227 | 227 |
228 #include <launch.h> | 228 #include <launch.h> |
229 #include <sys/stat.h> | 229 #include <sys/stat.h> |
230 | 230 |
231 #include "base/file_path.h" | 231 #include "base/file_path.h" |
232 #include "base/file_util.h" | 232 #include "base/file_util.h" |
233 #include "base/mac/mac_util.h" | 233 #include "base/mac/mac_util.h" |
234 #include "base/mac/scoped_cftyperef.h" | 234 #include "base/mac/scoped_cftyperef.h" |
235 #include "base/memory/scoped_temp_dir.h" | |
236 #include "base/message_loop.h" | 235 #include "base/message_loop.h" |
| 236 #include "base/scoped_temp_dir.h" |
237 #include "base/stringprintf.h" | 237 #include "base/stringprintf.h" |
238 #include "base/sys_string_conversions.h" | 238 #include "base/sys_string_conversions.h" |
239 #include "base/test/test_timeouts.h" | 239 #include "base/test/test_timeouts.h" |
240 #include "base/threading/thread.h" | 240 #include "base/threading/thread.h" |
241 #include "chrome/common/launchd_mac.h" | 241 #include "chrome/common/launchd_mac.h" |
242 #include "testing/gtest/include/gtest/gtest.h" | 242 #include "testing/gtest/include/gtest/gtest.h" |
243 | 243 |
244 // TODO(dmaclach): Write this in terms of a real mock. | 244 // TODO(dmaclach): Write this in terms of a real mock. |
245 // http://crbug.com/76923 | 245 // http://crbug.com/76923 |
246 class MockLaunchd : public Launchd { | 246 class MockLaunchd : public Launchd { |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 ScopedAttributesRestorer restorer(bundle_path(), 0777); | 541 ScopedAttributesRestorer restorer(bundle_path(), 0777); |
542 GetIOMessageLoopProxy()->PostTask( | 542 GetIOMessageLoopProxy()->PostTask( |
543 FROM_HERE, | 543 FROM_HERE, |
544 NewRunnableFunction(&ChangeAttr, bundle_path(), 0222)); | 544 NewRunnableFunction(&ChangeAttr, bundle_path(), 0222)); |
545 Run(); | 545 Run(); |
546 ASSERT_TRUE(mock_launchd()->remove_called()); | 546 ASSERT_TRUE(mock_launchd()->remove_called()); |
547 ASSERT_TRUE(mock_launchd()->delete_called()); | 547 ASSERT_TRUE(mock_launchd()->delete_called()); |
548 } | 548 } |
549 | 549 |
550 #endif // !OS_MACOSX | 550 #endif // !OS_MACOSX |
OLD | NEW |