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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 UIApplication* application = [UIApplication sharedApplication]; | 144 UIApplication* application = [UIApplication sharedApplication]; |
145 [application _terminateWithStatus:exitStatus]; | 145 [application _terminateWithStatus:exitStatus]; |
146 | 146 |
147 exit(exitStatus); | 147 exit(exitStatus); |
148 } | 148 } |
149 | 149 |
150 @end | 150 @end |
151 | 151 |
152 namespace { | 152 namespace { |
153 | 153 |
154 base::MessagePump* CreateMessagePumpForUIForTests() { | 154 scoped_ptr<base::MessagePump> CreateMessagePumpForUIForTests() { |
155 // A default MessagePump will do quite nicely in tests. | 155 // A default MessagePump will do quite nicely in tests. |
156 return new base::MessagePumpDefault(); | 156 return scoped_ptr<base::MessagePump>(new base::MessagePumpDefault()); |
157 } | 157 } |
158 | 158 |
159 } // namespace | 159 } // namespace |
160 | 160 |
161 namespace base { | 161 namespace base { |
162 | 162 |
163 void InitIOSTestMessageLoop() { | 163 void InitIOSTestMessageLoop() { |
164 MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIForTests); | 164 MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUIForTests); |
165 } | 165 } |
166 | 166 |
(...skipping 16 matching lines...) Expand all Loading... |
183 if (!ran_hook) { | 183 if (!ran_hook) { |
184 ran_hook = true; | 184 ran_hook = true; |
185 mac::ScopedNSAutoreleasePool pool; | 185 mac::ScopedNSAutoreleasePool pool; |
186 int exit_status = UIApplicationMain(g_argc, g_argv, nil, | 186 int exit_status = UIApplicationMain(g_argc, g_argv, nil, |
187 @"ChromeUnitTestDelegate"); | 187 @"ChromeUnitTestDelegate"); |
188 exit(exit_status); | 188 exit(exit_status); |
189 } | 189 } |
190 } | 190 } |
191 | 191 |
192 } // namespace base | 192 } // namespace base |
OLD | NEW |