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

Unified Diff: webrtc/test/mac/run_test.mm

Issue 2781713004: GN: Enable ARC for Mac and iOS in rtc_* templates (Closed)
Patch Set: Rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/BUILD.gn ('k') | webrtc/test/mac/video_renderer_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/mac/run_test.mm
diff --git a/webrtc/test/mac/run_test.mm b/webrtc/test/mac/run_test.mm
index 4e0093a9b6e40f6c13b52ede10e0bdd0cc100bd7..d6df69c46a8cf91c3bad40fe00f9a9205435215f 100644
--- a/webrtc/test/mac/run_test.mm
+++ b/webrtc/test/mac/run_test.mm
@@ -36,10 +36,10 @@ TestBlock functionToBlock(void(*function)()) {
}
- (void)runAllTests:(TestBlock)testBlock {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- testBlock();
- running_ = NO;
- [pool release];
+ @autoreleasepool {
+ testBlock();
+ running_ = NO;
+ }
}
- (BOOL)running {
@@ -51,24 +51,23 @@ namespace webrtc {
namespace test {
void RunTest(void(*test)()) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- [NSApplication sharedApplication];
+ @autoreleasepool {
+ [NSApplication sharedApplication];
- // Convert the function pointer to an Objective-C block and call on a
- // separate thread, to avoid blocking the main thread.
- TestRunner *testRunner = [[TestRunner alloc] init];
- TestBlock testBlock = functionToBlock(test);
- [NSThread detachNewThreadSelector:@selector(runAllTests:)
- toTarget:testRunner
- withObject:testBlock];
+ // Convert the function pointer to an Objective-C block and call on a
+ // separate thread, to avoid blocking the main thread.
+ TestRunner *testRunner = [[TestRunner alloc] init];
+ TestBlock testBlock = functionToBlock(test);
+ [NSThread detachNewThreadSelector:@selector(runAllTests:)
+ toTarget:testRunner
+ withObject:testBlock];
- NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
- while ([testRunner running] &&
- [runLoop runMode:NSDefaultRunLoopMode
- beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]);
+ NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
+ while ([testRunner running] &&
+ [runLoop runMode:NSDefaultRunLoopMode
+ beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]);
+ }
- [testRunner release];
- [pool release];
}
} // namespace test
« no previous file with comments | « webrtc/test/BUILD.gn ('k') | webrtc/test/mac/video_renderer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698