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

Unified Diff: mojo/shell/shell_test_base_unittest.cc

Issue 394903005: mojo: terminate apps if the shell goes away (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable tests that touch nss for now Created 6 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 | « mojo/shell/context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/shell_test_base_unittest.cc
diff --git a/mojo/shell/shell_test_base_unittest.cc b/mojo/shell/shell_test_base_unittest.cc
index 446ab09e4f0824fef3efacc9f858b94d197aa973..9812997f9f27b98a82dccd76d9ed4c673c3ba4ee 100644
--- a/mojo/shell/shell_test_base_unittest.cc
+++ b/mojo/shell/shell_test_base_unittest.cc
@@ -135,7 +135,8 @@ TEST_F(ShellTestBaseTest, ConnectInvalidService) {
// Tests that we can connect to a single service within a single app using
// a network based loader instead of local files.
-// TODO(tim): Bug 394477. NetworkService doesn't currently terminate.
+// TODO(tim): Disabled because network service leaks NSS at exit, meaning
+// subsequent tests can't init properly.
TEST_F(ShellTestBaseTest, DISABLED_ConnectBasicNetwork) {
InterfacePtr<TestService> service;
service.Bind(ConnectToServiceViaNetwork(
@@ -152,13 +153,17 @@ TEST_F(ShellTestBaseTest, DISABLED_ConnectBasicNetwork) {
// magically exit when TestService is destroyed (unlike ConnectBasic).
// Tearing down the shell context will kill connections. The shell loop will
// exit as soon as no more apps are connected.
- shell_context()->Shutdown();
- message_loop()->Run();
+ // TODO(tim): crbug.com/392685. Calling this explicitly shouldn't be
+ // necessary once the shell terminates if the primordial app exits, which
+ // we could enforce here by resetting |service|.
+ shell_context()->service_manager()->TerminateShellConnections();
+ message_loop()->Run(); // Waits for all connections to die.
}
// Tests that trying to connect to a service over network fails preoprly
// if the service doesn't exist.
-// TODO(tim): Bug 394477. NetworkService doesn't currently terminate.
+// TODO(tim): Disabled because network service leaks NSS at exit, meaning
+// subsequent tests can't init properly.
TEST_F(ShellTestBaseTest, DISABLED_ConnectInvalidServiceNetwork) {
InterfacePtr<TestService> test_service;
test_service.Bind(ConnectToServiceViaNetwork(
@@ -170,8 +175,11 @@ TEST_F(ShellTestBaseTest, DISABLED_ConnectInvalidServiceNetwork) {
message_loop()->Run();
EXPECT_TRUE(test_service.encountered_error());
- shell_context()->Shutdown();
- message_loop()->Run();
+ // TODO(tim): crbug.com/392685. Calling this explicitly shouldn't be
+ // necessary once the shell terminates if the primordial app exits, which
+ // we could enforce here by resetting |service|.
+ shell_context()->service_manager()->TerminateShellConnections();
+ message_loop()->Run(); // Waits for all connections to die.
}
// Similar to ConnectBasic, but causes the app to instantiate multiple
« no previous file with comments | « mojo/shell/context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698