Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2774)

Unified Diff: chrome/browser/process_singleton_posix_unittest.cc

Issue 218883008: Use process_singleton_linux on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments (mostly) Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/process_singleton_posix_unittest.cc
diff --git a/chrome/browser/process_singleton_linux_unittest.cc b/chrome/browser/process_singleton_posix_unittest.cc
similarity index 93%
rename from chrome/browser/process_singleton_linux_unittest.cc
rename to chrome/browser/process_singleton_posix_unittest.cc
index 689a2dfaf1e0c0e07d07f8c6dc564c3fa191cccf..565f011692924f7f530423d489a20559a3b77fcd 100644
--- a/chrome/browser/process_singleton_linux_unittest.cc
+++ b/chrome/browser/process_singleton_posix_unittest.cc
@@ -31,7 +31,7 @@ using content::BrowserThread;
namespace {
-class ProcessSingletonLinuxTest : public testing::Test {
+class ProcessSingletonPosixTest : public testing::Test {
public:
// A ProcessSingleton exposing some protected methods for testing.
class TestableProcessSingleton : public ProcessSingleton {
@@ -58,7 +58,7 @@ class ProcessSingletonLinuxTest : public testing::Test {
}
};
- ProcessSingletonLinuxTest()
+ ProcessSingletonPosixTest()
: kill_callbacks_(0),
io_thread_(BrowserThread::IO),
wait_event_(true, false),
@@ -89,7 +89,7 @@ class ProcessSingletonLinuxTest : public testing::Test {
if (process_singleton_on_thread_) {
worker_thread_->message_loop()->PostTask(
FROM_HERE,
- base::Bind(&ProcessSingletonLinuxTest::DestructProcessSingleton,
+ base::Bind(&ProcessSingletonPosixTest::DestructProcessSingleton,
base::Unretained(this)));
scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
@@ -108,7 +108,7 @@ class ProcessSingletonLinuxTest : public testing::Test {
worker_thread_->message_loop()->PostTask(
FROM_HERE,
- base::Bind(&ProcessSingletonLinuxTest::
+ base::Bind(&ProcessSingletonPosixTest::
CreateProcessSingletonInternal,
base::Unretained(this)));
@@ -132,7 +132,7 @@ class ProcessSingletonLinuxTest : public testing::Test {
process_singleton->OverrideCurrentPidForTesting(
base::GetCurrentProcId() + 1);
process_singleton->OverrideKillCallbackForTesting(
- base::Bind(&ProcessSingletonLinuxTest::KillCallback,
+ base::Bind(&ProcessSingletonPosixTest::KillCallback,
base::Unretained(this)));
}
@@ -172,7 +172,7 @@ class ProcessSingletonLinuxTest : public testing::Test {
void BlockWorkerThread() {
worker_thread_->message_loop()->PostTask(
FROM_HERE,
- base::Bind(&ProcessSingletonLinuxTest::BlockThread,
+ base::Bind(&ProcessSingletonPosixTest::BlockThread,
base::Unretained(this)));
}
@@ -219,10 +219,10 @@ class ProcessSingletonLinuxTest : public testing::Test {
} // namespace
-// Test if the socket file and symbol link created by ProcessSingletonLinux
+// Test if the socket file and symbol link created by ProcessSingletonPosix
// are valid.
// If this test flakes, use http://crbug.com/74554.
-TEST_F(ProcessSingletonLinuxTest, CheckSocketFile) {
+TEST_F(ProcessSingletonPosixTest, CheckSocketFile) {
CreateProcessSingletonOnThread();
struct stat statbuf;
ASSERT_EQ(0, lstat(lock_path_.value().c_str(), &statbuf));
@@ -254,7 +254,7 @@ TEST_F(ProcessSingletonLinuxTest, CheckSocketFile) {
// TODO(james.su@gmail.com): port following tests to Windows.
// Test success case of NotifyOtherProcess().
-TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessSuccess) {
+TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessSuccess) {
CreateProcessSingletonOnThread();
EXPECT_EQ(ProcessSingleton::PROCESS_NOTIFIED,
NotifyOtherProcess(true, TestTimeouts::action_timeout()));
@@ -262,7 +262,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessSuccess) {
}
// Test failure case of NotifyOtherProcess().
-TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessFailure) {
+TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessFailure) {
CreateProcessSingletonOnThread();
BlockWorkerThread();
@@ -275,7 +275,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessFailure) {
// Test that we don't kill ourselves by accident if a lockfile with the same pid
// happens to exist.
-TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessNoSuicide) {
+TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessNoSuicide) {
CreateProcessSingletonOnThread();
// Replace lockfile with one containing our own pid.
EXPECT_EQ(0, unlink(lock_path_.value().c_str()));
@@ -296,7 +296,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessNoSuicide) {
// Test that we can still notify a process on the same host even after the
// hostname changed.
-TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessHostChanged) {
+TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessHostChanged) {
CreateProcessSingletonOnThread();
EXPECT_EQ(0, unlink(lock_path_.value().c_str()));
EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path_.value().c_str()));
@@ -308,7 +308,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessHostChanged) {
// Test that we fail when lock says process is on another host and we can't
// notify it over the socket.
-TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessDifferingHost) {
+TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessDifferingHost) {
CreateProcessSingletonOnThread();
BlockWorkerThread();
@@ -326,7 +326,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessDifferingHost) {
// Test that we fail when lock says process is on another host and we can't
// notify it over the socket.
-TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessOrCreate_DifferingHost) {
+TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessOrCreate_DifferingHost) {
CreateProcessSingletonOnThread();
BlockWorkerThread();
@@ -344,7 +344,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessOrCreate_DifferingHost) {
}
// Test that Create fails when another browser is using the profile directory.
-TEST_F(ProcessSingletonLinuxTest, CreateFailsWithExistingBrowser) {
+TEST_F(ProcessSingletonPosixTest, CreateFailsWithExistingBrowser) {
CreateProcessSingletonOnThread();
scoped_ptr<TestableProcessSingleton> process_singleton(
@@ -355,7 +355,7 @@ TEST_F(ProcessSingletonLinuxTest, CreateFailsWithExistingBrowser) {
// Test that Create fails when another browser is using the profile directory
// but with the old socket location.
-TEST_F(ProcessSingletonLinuxTest, CreateChecksCompatibilitySocket) {
+TEST_F(ProcessSingletonPosixTest, CreateChecksCompatibilitySocket) {
CreateProcessSingletonOnThread();
scoped_ptr<TestableProcessSingleton> process_singleton(
CreateProcessSingleton());
@@ -376,7 +376,7 @@ TEST_F(ProcessSingletonLinuxTest, CreateChecksCompatibilitySocket) {
// Test that we fail when lock says process is on another host and we can't
// notify it over the socket before of a bad cookie.
-TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessOrCreate_BadCookie) {
+TEST_F(ProcessSingletonPosixTest, NotifyOtherProcessOrCreate_BadCookie) {
CreateProcessSingletonOnThread();
// Change the cookie.
EXPECT_EQ(0, unlink(cookie_path_.value().c_str()));

Powered by Google App Engine
This is Rietveld 408576698