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

Unified Diff: mojo/public/cpp/application/lib/application_test_base.cc

Issue 795593004: Update mojo sdk to rev cc531b32182099a5a034a99daff35ed5d38a61c8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More workarounds for MSVC Created 6 years 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/public/cpp/application/application_test_base.h ('k') | mojo/public/cpp/bindings/interface_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..864289e2f2e99513f816a5cbaecf00193b572cc5 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 (ShouldCreateDefaultRunLoop())
+ 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 (ShouldCreateDefaultRunLoop())
+ Environment::DestroyDefaultRunLoop();
+}
+
+bool ApplicationTestBase::ShouldCreateDefaultRunLoop() {
+ return true;
}
} // namespace test
« no previous file with comments | « mojo/public/cpp/application/application_test_base.h ('k') | mojo/public/cpp/bindings/interface_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698