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

Unified Diff: webrtc/test/testsupport/mac/run_threaded_main_mac.mm

Issue 2540693002: Replace test_support_main by test_main and get rid of test_support_main_threaded_mac (Closed)
Patch Set: Adressed comments. Created 4 years 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/testsupport/mac/run_threaded_main_mac.h ('k') | webrtc/tools/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/testsupport/mac/run_threaded_main_mac.mm
diff --git a/webrtc/test/testsupport/mac/run_threaded_main_mac.mm b/webrtc/test/testsupport/mac/run_threaded_main_mac.mm
deleted file mode 100644
index 4a908fbf2dd968c7a26dc911537f092fee924c80..0000000000000000000000000000000000000000
--- a/webrtc/test/testsupport/mac/run_threaded_main_mac.mm
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#import "webrtc/test/testsupport/mac/run_threaded_main_mac.h"
-
-#import <Cocoa/Cocoa.h>
-
-// This class passes parameter from main to the worked thread and back.
-@interface AutoTestInWorkerThread : NSObject {
- int argc_;
- char** argv_;
- int result_;
- bool done_;
-}
-
-- (void)setDone:(bool)done;
-- (bool)done;
-- (void)setArgc:(int)argc argv:(char**)argv;
-- (int) result;
-- (void)runTest:(NSObject*)ignored;
-
-@end
-
-@implementation AutoTestInWorkerThread
-
-- (void)setDone:(bool)done {
- done_ = done;
-}
-
-- (bool)done {
- return done_;
-}
-
-- (void)setArgc:(int)argc argv:(char**)argv {
- argc_ = argc;
- argv_ = argv;
-}
-
-- (void)runTest:(NSObject*)ignored {
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
-
- result_ = ImplementThisToRunYourTest(argc_, argv_);
- done_ = true;
-
- [pool release];
- return;
-}
-
-- (int)result {
- return result_;
-}
-
-@end
-
-int main(int argc, char * argv[]) {
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
-
- [NSApplication sharedApplication];
-
- int result = 0;
- AutoTestInWorkerThread* tests = [[AutoTestInWorkerThread alloc] init];
-
- [tests setArgc:argc argv:argv];
- [tests setDone:false];
-
- [NSThread detachNewThreadSelector:@selector(runTest:)
- toTarget:tests
- withObject:nil];
-
- NSRunLoop* main_run_loop = [NSRunLoop mainRunLoop];
- NSDate *loop_until = [NSDate dateWithTimeIntervalSinceNow:0.1];
- bool runloop_ok = true;
- while (![tests done] && runloop_ok) {
- runloop_ok = [main_run_loop runMode:NSDefaultRunLoopMode
- beforeDate:loop_until];
- loop_until = [NSDate dateWithTimeIntervalSinceNow:0.1];
- }
-
- result = [tests result];
-
- [pool release];
- return result;
-}
« no previous file with comments | « webrtc/test/testsupport/mac/run_threaded_main_mac.h ('k') | webrtc/tools/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698