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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 68 |
69 // This tests the case when a service process is launched when browser | 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. | 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 | 71 IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, DISABLED_LaunchTwice) { |
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. | 72 // Launch the service process the first time. |
77 LaunchServiceProcessControl(); | 73 LaunchServiceProcessControl(); |
78 | 74 |
79 // Make sure we are connected to the service process. | 75 // Make sure we are connected to the service process. |
80 EXPECT_TRUE(process()->is_connected()); | 76 EXPECT_TRUE(process()->is_connected()); |
81 SayHelloAndWait(); | 77 SayHelloAndWait(); |
82 | 78 |
83 // Launch the service process again. | 79 // Launch the service process again. |
84 LaunchServiceProcessControl(); | 80 LaunchServiceProcessControl(); |
85 EXPECT_TRUE(process()->is_connected()); | 81 EXPECT_TRUE(process()->is_connected()); |
86 SayHelloAndWait(); | 82 SayHelloAndWait(); |
87 | 83 |
88 // And then shutdown the service process. | 84 // And then shutdown the service process. |
89 EXPECT_TRUE(process()->Shutdown()); | 85 EXPECT_TRUE(process()->Shutdown()); |
90 } | 86 } |
91 #endif | 87 #endif |
92 | 88 |
93 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); | 89 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); |
OLD | NEW |