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

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

Issue 1709173002: mojo: Delay ApplicationTestBase shell disconnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: initial approach Created 4 years, 10 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 | « no previous file | mojo/tools/data/apptests » ('j') | 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 <utility> 5 #include <utility>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 CHECK(g_shell); 154 CHECK(g_shell);
155 155
156 // New applications are constructed for each test to avoid persisting state. 156 // New applications are constructed for each test to avoid persisting state.
157 test_helper_.reset(new TestHelper(GetShellClient())); 157 test_helper_.reset(new TestHelper(GetShellClient()));
158 } 158 }
159 159
160 void ApplicationTestBase::TearDown() { 160 void ApplicationTestBase::TearDown() {
161 CHECK(!g_shell_client_request.is_pending()); 161 CHECK(!g_shell_client_request.is_pending());
162 CHECK(!g_shell); 162 CHECK(!g_shell);
163 163
164 test_helper_.reset();
165
166 if (ShouldCreateDefaultRunLoop()) 164 if (ShouldCreateDefaultRunLoop())
167 Environment::DestroyDefaultRunLoop(); 165 Environment::DestroyDefaultRunLoop();
msw 2016/02/23 18:02:42 Does the order of closing the connection and destr
msw 2016/02/23 18:03:44 Sorry, ignore this old comment.
xhwang 2016/02/23 18:05:39 Actually it's a good question, and I don't know en
168 } 166 }
169 167
170 bool ApplicationTestBase::ShouldCreateDefaultRunLoop() { 168 bool ApplicationTestBase::ShouldCreateDefaultRunLoop() {
171 return true; 169 return true;
172 } 170 }
173 171
174 } // namespace test 172 } // namespace test
175 } // namespace mojo 173 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/tools/data/apptests » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698