OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/test/in_process_browser_test.h" | 5 #include "chrome/test/in_process_browser_test.h" |
6 #include "chrome/test/ui_test_utils.h" | 6 #include "chrome/test/ui_test_utils.h" |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/service/service_process_control.h" | 8 #include "chrome/browser/service/service_process_control.h" |
9 #include "chrome/browser/service/service_process_control_manager.h" | 9 #include "chrome/browser/service/service_process_control_manager.h" |
10 #include "chrome/common/service_process_type.h" | 10 #include "chrome/common/service_process_type.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, LaunchAndIPC) { | 58 IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, LaunchAndIPC) { |
59 LaunchServiceProcessControl(); | 59 LaunchServiceProcessControl(); |
60 | 60 |
61 // Make sure we are connected to the service process. | 61 // Make sure we are connected to the service process. |
62 EXPECT_TRUE(process()->is_connected()); | 62 EXPECT_TRUE(process()->is_connected()); |
63 SayHelloAndWait(); | 63 SayHelloAndWait(); |
64 | 64 |
65 // And then shutdown the service process. | 65 // And then shutdown the service process. |
66 EXPECT_TRUE(process()->Shutdown()); | 66 EXPECT_TRUE(process()->Shutdown()); |
67 } | 67 } |
| 68 |
| 69 // This tests the case when a service process is launched when browser |
| 70 // starts but we try to launch it again in the remoting setup dialog. |
| 71 // TODO(hclam): We actually need to implement singleton in the service |
| 72 // process so that even if we launch the service process twice one |
| 73 // of the them will shutdown itself and we are still able to connect |
| 74 // to the first one that gets executed. |
| 75 IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, LaunchTwice) { |
| 76 // Launch the service process the first time. |
| 77 LaunchServiceProcessControl(); |
| 78 |
| 79 // Make sure we are connected to the service process. |
| 80 EXPECT_TRUE(process()->is_connected()); |
| 81 SayHelloAndWait(); |
| 82 |
| 83 // Launch the service process again. |
| 84 LaunchServiceProcessControl(); |
| 85 EXPECT_TRUE(process()->is_connected()); |
| 86 SayHelloAndWait(); |
| 87 |
| 88 // And then shutdown the service process. |
| 89 EXPECT_TRUE(process()->Shutdown()); |
| 90 } |
68 #endif | 91 #endif |
69 | 92 |
70 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); | 93 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); |
OLD | NEW |