OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <sys/un.h> | 10 #include <sys/un.h> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 void DestructProcessSingleton() { | 246 void DestructProcessSingleton() { |
247 ASSERT_TRUE(process_singleton_on_thread_); | 247 ASSERT_TRUE(process_singleton_on_thread_); |
248 delete process_singleton_on_thread_; | 248 delete process_singleton_on_thread_; |
249 } | 249 } |
250 | 250 |
251 void KillCallback(int pid) { | 251 void KillCallback(int pid) { |
252 kill_callbacks_++; | 252 kill_callbacks_++; |
253 } | 253 } |
254 | 254 |
| 255 base::MessageLoop message_loop_; |
255 content::TestBrowserThread io_thread_; | 256 content::TestBrowserThread io_thread_; |
256 base::ScopedTempDir temp_dir_; | 257 base::ScopedTempDir temp_dir_; |
257 base::WaitableEvent wait_event_; | 258 base::WaitableEvent wait_event_; |
258 base::WaitableEvent signal_event_; | 259 base::WaitableEvent signal_event_; |
259 | 260 |
260 scoped_ptr<base::Thread> worker_thread_; | 261 scoped_ptr<base::Thread> worker_thread_; |
261 TestableProcessSingleton* process_singleton_on_thread_; | 262 TestableProcessSingleton* process_singleton_on_thread_; |
262 }; | 263 }; |
263 | 264 |
264 } // namespace | 265 } // namespace |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 // Test that if there is an existing lock file, and it's not locked, we replace | 422 // Test that if there is an existing lock file, and it's not locked, we replace |
422 // it. | 423 // it. |
423 TEST_F(ProcessSingletonPosixTest, CreateReplacesOldMacLock) { | 424 TEST_F(ProcessSingletonPosixTest, CreateReplacesOldMacLock) { |
424 scoped_ptr<TestableProcessSingleton> process_singleton( | 425 scoped_ptr<TestableProcessSingleton> process_singleton( |
425 CreateProcessSingleton()); | 426 CreateProcessSingleton()); |
426 EXPECT_EQ(0, base::WriteFile(lock_path_, "", 0)); | 427 EXPECT_EQ(0, base::WriteFile(lock_path_, "", 0)); |
427 EXPECT_TRUE(process_singleton->Create()); | 428 EXPECT_TRUE(process_singleton->Create()); |
428 VerifyFiles(); | 429 VerifyFiles(); |
429 } | 430 } |
430 #endif // defined(OS_MACOSX) | 431 #endif // defined(OS_MACOSX) |
OLD | NEW |