Chromium Code Reviews| Index: chrome/common/service_process_util_unittest.cc |
| diff --git a/chrome/common/service_process_util_unittest.cc b/chrome/common/service_process_util_unittest.cc |
| index 6000b5cc3441276376a3c0acd31fe65c011ec32a..66077888e69611f9fad16b9a4666e92832c97ab0 100644 |
| --- a/chrome/common/service_process_util_unittest.cc |
| +++ b/chrome/common/service_process_util_unittest.cc |
| @@ -20,6 +20,9 @@ TEST(ServiceProcessUtilTest, ScopedVersionedName) { |
| #if defined(OS_WIN) |
| // Singleton-ness is only implemented on Windows. |
| +// TODO(sanjeev): Rewrite this test to spawn a new process and test using the |
| +// ServiceProcessState singleton across processes. |
| +/* |
| TEST(ServiceProcessStateTest, Singleton) { |
| ServiceProcessState state; |
| EXPECT_TRUE(state.Initialize()); |
| @@ -27,6 +30,7 @@ TEST(ServiceProcessStateTest, Singleton) { |
| ServiceProcessState another_state; |
| EXPECT_FALSE(another_state.Initialize()); |
| } |
| +*/ |
| #endif // defined(OS_WIN) |
| TEST(ServiceProcessStateTest, ReadyState) { |
| @@ -38,11 +42,11 @@ TEST(ServiceProcessStateTest, ReadyState) { |
| // Posix, this check will only execute on Windows. |
| EXPECT_FALSE(CheckServiceProcessReady()); |
| #endif // defined(OS_WIN) |
| - ServiceProcessState state; |
| - EXPECT_TRUE(state.Initialize()); |
| - state.SignalReady(NULL); |
| + ServiceProcessState* state = ServiceProcessState::GetInstance(); |
|
willchan no longer on Chromium
2010/12/08 00:58:46
Are you sure this is recommended? What do we do w
Satish
2010/12/08 12:58:22
Yes this is bound to have issues later on. I have
|
| + EXPECT_TRUE(state->Initialize()); |
| + state->SignalReady(NULL); |
| EXPECT_TRUE(CheckServiceProcessReady()); |
| - state.SignalStopped(); |
| + state->SignalStopped(); |
| EXPECT_FALSE(CheckServiceProcessReady()); |
| } |
| @@ -55,8 +59,8 @@ TEST(ServiceProcessStateTest, SharedMem) { |
| // implementation on Posix, this check will only execute on Windows. |
| EXPECT_EQ(0, GetServiceProcessPid()); |
| #endif // defined(OS_WIN) |
| - ServiceProcessState state; |
| - EXPECT_TRUE(state.Initialize()); |
| + ServiceProcessState* state = ServiceProcessState::GetInstance(); |
| + EXPECT_TRUE(state->Initialize()); |
| EXPECT_EQ(base::GetCurrentProcId(), GetServiceProcessPid()); |
| } |