Chromium Code Reviews| Index: mojo/public/cpp/application/lib/application_test_base.cc |
| diff --git a/mojo/public/cpp/application/lib/application_test_base.cc b/mojo/public/cpp/application/lib/application_test_base.cc |
| index 93eb3d0e5cf99239103c4719dad22eb191ca8edf..4ace9f566d38e5017f8ebb6225c7d14481fafa64 100644 |
| --- a/mojo/public/cpp/application/lib/application_test_base.cc |
| +++ b/mojo/public/cpp/application/lib/application_test_base.cc |
| @@ -57,8 +57,10 @@ ApplicationDelegate* ApplicationTestBase::GetApplicationDelegate() { |
| } |
| void ApplicationTestBase::SetUpWithArgs(const Array<String>& args) { |
| - // A run loop is needed for ApplicationImpl initialization and communication. |
| - Environment::InstantiateDefaultRunLoop(); |
| + // A run loop is recommended for ApplicationImpl initialization and |
| + // communication. |
| + if (IsDefaultLoopEnabled()) |
|
msw
2014/12/16 15:40:32
Hmm, I think all the current apptests would fail w
|
| + Environment::InstantiateDefaultRunLoop(); |
| // New applications are constructed for each test to avoid persisting state. |
| application_impl_ = new ApplicationImpl(GetApplicationDelegate(), |
| @@ -75,7 +77,12 @@ void ApplicationTestBase::SetUp() { |
| void ApplicationTestBase::TearDown() { |
| SetShellHandle(application_impl_->UnbindShell()); |
| delete application_impl_; |
| - Environment::DestroyDefaultRunLoop(); |
| + if (IsDefaultLoopEnabled()) |
| + Environment::DestroyDefaultRunLoop(); |
| +} |
| + |
| +bool ApplicationTestBase::IsDefaultLoopEnabled() { |
| + return true; |
| } |
| } // namespace test |