diff options
Diffstat (limited to 'mojo/public/cpp/application/lib/application_test_main.cc')
-rw-r--r-- | mojo/public/cpp/application/lib/application_test_main.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mojo/public/cpp/application/lib/application_test_main.cc b/mojo/public/cpp/application/lib/application_test_main.cc index 6cdfb0d..9b76dad1 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 @@ MojoResult MojoMain(MojoHandle shell_handle) { testing::InitGoogleTest(&argc, const_cast<char**>(&(argv[0]))); mojo::test::SetShellHandle(app.UnbindShell()); + mojo::Environment::DestroyDefaultRunLoop(); } int result = RUN_ALL_TESTS(); |