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

Unified Diff: chrome/browser/process_singleton_mac_unittest.cc

Issue 9968053: Refactor ProcessSingleton so that it may be used distinctly from a full browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment nits. Created 8 years, 9 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
« no previous file with comments | « chrome/browser/process_singleton_mac.cc ('k') | chrome/browser/process_singleton_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_singleton_mac_unittest.cc
diff --git a/chrome/browser/process_singleton_mac_unittest.cc b/chrome/browser/process_singleton_mac_unittest.cc
index 41dbdf267eacda1aa0f29f85b8807661c647fa0f..51312cdf28c4774ac35cc6a139a3c28fcbe07dc5 100644
--- a/chrome/browser/process_singleton_mac_unittest.cc
+++ b/chrome/browser/process_singleton_mac_unittest.cc
@@ -69,7 +69,7 @@ class ProcessSingletonMacTest : public PlatformTest {
TEST_F(ProcessSingletonMacTest, Basic) {
ProcessSingleton ps(temp_dir_.path());
EXPECT_FALSE(IsLocked());
- EXPECT_TRUE(ps.Create());
+ EXPECT_TRUE(ps.Create(ProcessSingleton::NotificationCallback()));
EXPECT_TRUE(IsLocked());
ps.Cleanup();
EXPECT_FALSE(IsLocked());
@@ -80,7 +80,7 @@ TEST_F(ProcessSingletonMacTest, DestructorReleases) {
EXPECT_FALSE(IsLocked());
{
ProcessSingleton ps(temp_dir_.path());
- EXPECT_TRUE(ps.Create());
+ EXPECT_TRUE(ps.Create(ProcessSingleton::NotificationCallback()));
EXPECT_TRUE(IsLocked());
}
EXPECT_FALSE(IsLocked());
@@ -99,16 +99,16 @@ TEST_F(ProcessSingletonMacTest, Interlock) {
// When |ps1| has the lock, |ps2| cannot get it.
EXPECT_FALSE(IsLocked());
- EXPECT_TRUE(ps1.Create());
+ EXPECT_TRUE(ps1.Create(ProcessSingleton::NotificationCallback()));
EXPECT_TRUE(IsLocked());
- EXPECT_FALSE(ps2.Create());
+ EXPECT_FALSE(ps2.Create(ProcessSingleton::NotificationCallback()));
ps1.Cleanup();
// And when |ps2| has the lock, |ps1| cannot get it.
EXPECT_FALSE(IsLocked());
- EXPECT_TRUE(ps2.Create());
+ EXPECT_TRUE(ps2.Create(ProcessSingleton::NotificationCallback()));
EXPECT_TRUE(IsLocked());
- EXPECT_FALSE(ps1.Create());
+ EXPECT_FALSE(ps1.Create(ProcessSingleton::NotificationCallback()));
ps2.Cleanup();
EXPECT_FALSE(IsLocked());
}
@@ -126,16 +126,24 @@ TEST_F(ProcessSingletonMacTest, NotifyOtherProcessOrCreate) {
// When |ps1| has the lock, |ps2| cannot get it.
EXPECT_FALSE(IsLocked());
- EXPECT_EQ(ProcessSingleton::PROCESS_NONE, ps1.NotifyOtherProcessOrCreate());
+ EXPECT_EQ(
+ ProcessSingleton::PROCESS_NONE,
+ ps1.NotifyOtherProcessOrCreate(ProcessSingleton::NotificationCallback()));
EXPECT_TRUE(IsLocked());
- EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, ps2.NotifyOtherProcessOrCreate());
+ EXPECT_EQ(
+ ProcessSingleton::PROFILE_IN_USE,
+ ps2.NotifyOtherProcessOrCreate(ProcessSingleton::NotificationCallback()));
ps1.Cleanup();
// And when |ps2| has the lock, |ps1| cannot get it.
EXPECT_FALSE(IsLocked());
- EXPECT_EQ(ProcessSingleton::PROCESS_NONE, ps2.NotifyOtherProcessOrCreate());
+ EXPECT_EQ(
+ ProcessSingleton::PROCESS_NONE,
+ ps2.NotifyOtherProcessOrCreate(ProcessSingleton::NotificationCallback()));
EXPECT_TRUE(IsLocked());
- EXPECT_EQ(ProcessSingleton::PROFILE_IN_USE, ps1.NotifyOtherProcessOrCreate());
+ EXPECT_EQ(
+ ProcessSingleton::PROFILE_IN_USE,
+ ps1.NotifyOtherProcessOrCreate(ProcessSingleton::NotificationCallback()));
ps2.Cleanup();
EXPECT_FALSE(IsLocked());
}
« no previous file with comments | « chrome/browser/process_singleton_mac.cc ('k') | chrome/browser/process_singleton_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698