OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
6 | 6 |
7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/scoped_nsautorelease_pool.h" | 9 #include "base/mac/scoped_nsautorelease_pool.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 // TODO(crbug.com/137010): Figure out how much time is actually needed, and | 162 // TODO(crbug.com/137010): Figure out how much time is actually needed, and |
163 // sleep only to make sure that much time has elapsed since launch. | 163 // sleep only to make sure that much time has elapsed since launch. |
164 [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:2.0]]; | 164 [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:2.0]]; |
165 _window.reset(); | 165 _window.reset(); |
166 | 166 |
167 // Use the hidden selector to try and cleanly take down the app (otherwise | 167 // Use the hidden selector to try and cleanly take down the app (otherwise |
168 // things can think the app crashed even on a zero exit status). | 168 // things can think the app crashed even on a zero exit status). |
169 UIApplication* application = [UIApplication sharedApplication]; | 169 UIApplication* application = [UIApplication sharedApplication]; |
170 [application _terminateWithStatus:exitStatus]; | 170 [application _terminateWithStatus:exitStatus]; |
171 | 171 |
172 coverage_util::FlushCoverageDataIfNecessary(); | 172 // TODO(lpromero): Enable. |
173 //coverage_util::SetupIfNecessary(); | |
lpromero
2017/03/31 11:22:06
I will re-enable this once I add the "-fprofile-in
| |
173 | 174 |
174 exit(exitStatus); | 175 exit(exitStatus); |
175 } | 176 } |
176 | 177 |
177 @end | 178 @end |
178 | 179 |
179 namespace { | 180 namespace { |
180 | 181 |
181 std::unique_ptr<base::MessagePump> CreateMessagePumpForUIForTests() { | 182 std::unique_ptr<base::MessagePump> CreateMessagePumpForUIForTests() { |
182 // A default MessagePump will do quite nicely in tests. | 183 // A default MessagePump will do quite nicely in tests. |
(...skipping 27 matching lines...) Expand all Loading... | |
210 if (!ran_hook) { | 211 if (!ran_hook) { |
211 ran_hook = true; | 212 ran_hook = true; |
212 mac::ScopedNSAutoreleasePool pool; | 213 mac::ScopedNSAutoreleasePool pool; |
213 int exit_status = UIApplicationMain(g_argc, g_argv, nil, | 214 int exit_status = UIApplicationMain(g_argc, g_argv, nil, |
214 @"ChromeUnitTestDelegate"); | 215 @"ChromeUnitTestDelegate"); |
215 exit(exit_status); | 216 exit(exit_status); |
216 } | 217 } |
217 } | 218 } |
218 | 219 |
219 } // namespace base | 220 } // namespace base |
OLD | NEW |