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

Side by Side Diff: mojo/application/public/cpp/lib/application_test_base.cc

Issue 1288743002: A few more spurious cleanups on ApplicationImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « mojo/application/public/cpp/lib/application_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/application/public/cpp/application_test_base.h" 5 #include "mojo/application/public/cpp/application_test_base.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "mojo/application/public/cpp/application_impl.h" 9 #include "mojo/application/public/cpp/application_impl.h"
10 #include "mojo/application/public/interfaces/application.mojom.h" 10 #include "mojo/application/public/interfaces/application.mojom.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 Environment::InstantiateDefaultRunLoop(); 123 Environment::InstantiateDefaultRunLoop();
124 124
125 MOJO_CHECK(g_application_request.is_pending()); 125 MOJO_CHECK(g_application_request.is_pending());
126 MOJO_CHECK(g_shell); 126 MOJO_CHECK(g_shell);
127 127
128 // New applications are constructed for each test to avoid persisting state. 128 // New applications are constructed for each test to avoid persisting state.
129 application_impl_ = new ApplicationImpl(GetApplicationDelegate(), 129 application_impl_ = new ApplicationImpl(GetApplicationDelegate(),
130 g_application_request.Pass()); 130 g_application_request.Pass());
131 131
132 // Fake application initialization. 132 // Fake application initialization.
133 application_impl_->Initialize(g_shell.Pass(), g_url); 133 Application* application = application_impl_;
134 application->Initialize(g_shell.Pass(), g_url);
134 } 135 }
135 136
136 void ApplicationTestBase::TearDown() { 137 void ApplicationTestBase::TearDown() {
137 MOJO_CHECK(!g_application_request.is_pending()); 138 MOJO_CHECK(!g_application_request.is_pending());
138 MOJO_CHECK(!g_shell); 139 MOJO_CHECK(!g_shell);
139 140
140 application_impl_->UnbindConnections(&g_application_request, &g_shell); 141 {
142 ApplicationImpl::TestApi test_api(application_impl_);
143 test_api.UnbindConnections(&g_application_request, &g_shell);
144 }
141 delete application_impl_; 145 delete application_impl_;
142 if (ShouldCreateDefaultRunLoop()) 146 if (ShouldCreateDefaultRunLoop())
143 Environment::DestroyDefaultRunLoop(); 147 Environment::DestroyDefaultRunLoop();
144 } 148 }
145 149
146 bool ApplicationTestBase::ShouldCreateDefaultRunLoop() { 150 bool ApplicationTestBase::ShouldCreateDefaultRunLoop() {
147 return true; 151 return true;
148 } 152 }
149 153
150 154
151 } // namespace test 155 } // namespace test
152 } // namespace mojo 156 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/application/public/cpp/lib/application_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698