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

Unified Diff: chrome/browser/service/service_process_control_browsertest.cc

Issue 3306001: Don't launch service process if it's already running (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: removed code Created 10 years, 4 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/service/service_process_control.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/service/service_process_control.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698