Index: mojo/public/cpp/application/lib/application_test_main.cc |
diff --git a/mojo/public/cpp/application/lib/application_test_main.cc b/mojo/public/cpp/application/lib/application_test_main.cc |
index 6cdfb0d7fa53eab272d69fdd3967e28ce3a0a038..9b76dad1cf842f4db27d85e0440a4821bab3badc 100644 |
--- a/mojo/public/cpp/application/lib/application_test_main.cc |
+++ b/mojo/public/cpp/application/lib/application_test_main.cc |
@@ -6,18 +6,16 @@ |
#include "mojo/public/cpp/application/application_delegate.h" |
#include "mojo/public/cpp/application/application_impl.h" |
#include "mojo/public/cpp/application/application_test_base.h" |
-#include "mojo/public/cpp/environment/environment.h" |
#include "mojo/public/cpp/environment/logging.h" |
#include "mojo/public/cpp/system/message_pipe.h" |
-#include "mojo/public/cpp/utility/run_loop.h" |
MojoResult MojoMain(MojoHandle shell_handle) { |
// An Environment instance is needed to construct run loops. |
mojo::Environment environment; |
{ |
- // This loop is used for init, and then destroyed before running tests. |
- mojo::RunLoop run_loop; |
+ // This RunLoop is used for init, and then destroyed before running tests. |
+ mojo::Environment::InstantiateDefaultRunLoop(); |
// Construct an ApplicationImpl just for the GTEST commandline arguments. |
// GTEST command line arguments are supported amid application arguments: |
@@ -40,6 +38,7 @@ |
testing::InitGoogleTest(&argc, const_cast<char**>(&(argv[0]))); |
mojo::test::SetShellHandle(app.UnbindShell()); |
+ mojo::Environment::DestroyDefaultRunLoop(); |
} |
int result = RUN_ALL_TESTS(); |