Chromium Code Reviews| 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/browser/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <sys/wait.h> | 9 #include <sys/wait.h> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 #include "base/threading/thread.h" | 24 #include "base/threading/thread.h" |
| 25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
| 26 #include "content/public/test/test_browser_thread.h" | 26 #include "content/public/test/test_browser_thread.h" |
| 27 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 | 29 |
| 30 using content::BrowserThread; | 30 using content::BrowserThread; |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 class ProcessSingletonLinuxTest : public testing::Test { | 34 class ProcessSingletonLinuxTest : public testing::Test { |
|
tapted
2014/04/08 17:56:44
nit: this should probably be renamed Linux -> Posi
jackhou1
2014/04/14 04:12:10
Done.
| |
| 35 public: | 35 public: |
| 36 // A ProcessSingleton exposing some protected methods for testing. | 36 // A ProcessSingleton exposing some protected methods for testing. |
| 37 class TestableProcessSingleton : public ProcessSingleton { | 37 class TestableProcessSingleton : public ProcessSingleton { |
| 38 public: | 38 public: |
| 39 explicit TestableProcessSingleton(const base::FilePath& user_data_dir) | 39 explicit TestableProcessSingleton(const base::FilePath& user_data_dir) |
| 40 : ProcessSingleton( | 40 : ProcessSingleton( |
| 41 user_data_dir, | 41 user_data_dir, |
| 42 base::Bind(&TestableProcessSingleton::NotificationCallback, | 42 base::Bind(&TestableProcessSingleton::NotificationCallback, |
| 43 base::Unretained(this))) {} | 43 base::Unretained(this))) {} |
| 44 | 44 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 | 384 |
| 385 // Also change the hostname, so the remote does not retry. | 385 // Also change the hostname, so the remote does not retry. |
| 386 EXPECT_EQ(0, unlink(lock_path_.value().c_str())); | 386 EXPECT_EQ(0, unlink(lock_path_.value().c_str())); |
| 387 EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path_.value().c_str())); | 387 EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path_.value().c_str())); |
| 388 | 388 |
| 389 std::string url("about:blank"); | 389 std::string url("about:blank"); |
| 390 EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, | 390 EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, |
| 391 NotifyOtherProcessOrCreate(url, TestTimeouts::action_timeout())); | 391 NotifyOtherProcessOrCreate(url, TestTimeouts::action_timeout())); |
| 392 } | 392 } |
| 393 | 393 |
| OLD | NEW |