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 <limits.h> |
8 #include <signal.h> | 9 #include <signal.h> |
9 #include <stddef.h> | 10 #include <stddef.h> |
10 #include <sys/types.h> | 11 #include <sys/types.h> |
11 #include <sys/un.h> | 12 #include <sys/un.h> |
12 #include <sys/wait.h> | 13 #include <sys/wait.h> |
13 #include <unistd.h> | 14 #include <unistd.h> |
14 | 15 |
15 #include <string> | 16 #include <string> |
16 #include <vector> | 17 #include <vector> |
17 | 18 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // Test that if there is an existing lock file, and it's not locked, we replace | 424 // Test that if there is an existing lock file, and it's not locked, we replace |
424 // it. | 425 // it. |
425 TEST_F(ProcessSingletonPosixTest, CreateReplacesOldMacLock) { | 426 TEST_F(ProcessSingletonPosixTest, CreateReplacesOldMacLock) { |
426 scoped_ptr<TestableProcessSingleton> process_singleton( | 427 scoped_ptr<TestableProcessSingleton> process_singleton( |
427 CreateProcessSingleton()); | 428 CreateProcessSingleton()); |
428 EXPECT_EQ(0, base::WriteFile(lock_path_, "", 0)); | 429 EXPECT_EQ(0, base::WriteFile(lock_path_, "", 0)); |
429 EXPECT_TRUE(process_singleton->Create()); | 430 EXPECT_TRUE(process_singleton->Create()); |
430 VerifyFiles(); | 431 VerifyFiles(); |
431 } | 432 } |
432 #endif // defined(OS_MACOSX) | 433 #endif // defined(OS_MACOSX) |
OLD | NEW |