Index: chrome/browser/service/service_process_control_browsertest.cc |
diff --git a/chrome/browser/service/service_process_control_browsertest.cc b/chrome/browser/service/service_process_control_browsertest.cc |
index 0dda5face0af744ea72c2bd035b50cb3348f8295..30e65c163499cff69a04ac8a3520bf6af321c7f1 100644 |
--- a/chrome/browser/service/service_process_control_browsertest.cc |
+++ b/chrome/browser/service/service_process_control_browsertest.cc |
@@ -65,6 +65,29 @@ IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, LaunchAndIPC) { |
// And then shutdown the service process. |
EXPECT_TRUE(process()->Shutdown()); |
} |
+ |
+// This tests the case when a service process is launched when browser |
+// starts but we try to launch it again in the remoting setup dialog. |
+// TODO(hclam): We actually need to implement singleton in the service |
+// process so that even if we launch the service process twice one |
+// of the them will shutdown itself and we are still able to connect |
+// to the first one that gets executed. |
+IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, LaunchTwice) { |
+ // Launch the service process the first time. |
+ LaunchServiceProcessControl(); |
+ |
+ // Make sure we are connected to the service process. |
+ EXPECT_TRUE(process()->is_connected()); |
+ SayHelloAndWait(); |
+ |
+ // Launch the service process again. |
+ LaunchServiceProcessControl(); |
+ EXPECT_TRUE(process()->is_connected()); |
+ SayHelloAndWait(); |
+ |
+ // And then shutdown the service process. |
+ EXPECT_TRUE(process()->Shutdown()); |
+} |
#endif |
DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); |