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

Side by Side Diff: testing/iossim/iossim.mm

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « testing/gmock.gyp ('k') | testing/scripts/OWNERS » ('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 (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 <Foundation/Foundation.h> 5 #import <Foundation/Foundation.h>
6 #include <asl.h> 6 #include <asl.h>
7 #include <libgen.h> 7 #include <libgen.h>
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 10
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // window). As a workaround, iossim creates a temp file to hold output, which 313 // window). As a workaround, iossim creates a temp file to hold output, which
314 // this method reads and copies to stdout. 314 // this method reads and copies to stdout.
315 - (void)tailOutputForSession:(DTiPhoneSimulatorSession*)session { 315 - (void)tailOutputForSession:(DTiPhoneSimulatorSession*)session {
316 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; 316 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
317 317
318 NSFileHandle* simio = [NSFileHandle fileHandleForReadingAtPath:stdioPath_]; 318 NSFileHandle* simio = [NSFileHandle fileHandleForReadingAtPath:stdioPath_];
319 if (IsRunningWithXcode6OrLater()) { 319 if (IsRunningWithXcode6OrLater()) {
320 #if defined(IOSSIM_USE_XCODE_6) 320 #if defined(IOSSIM_USE_XCODE_6)
321 // With iOS 8 simulators on Xcode 6, the app output is relative to the 321 // With iOS 8 simulators on Xcode 6, the app output is relative to the
322 // simulator's data directory. 322 // simulator's data directory.
323 if ([session.sessionConfig.simulatedSystemRoot.sdkVersion isEqual:@"8.0"]) { 323 NSString* versionString =
324 [[[session sessionConfig] simulatedSystemRoot] sdkVersion];
325 NSInteger majorVersion = [[[versionString componentsSeparatedByString:@"."]
326 objectAtIndex:0] intValue];
327 if (majorVersion >= 8) {
324 NSString* dataPath = session.sessionConfig.device.dataPath; 328 NSString* dataPath = session.sessionConfig.device.dataPath;
325 NSString* appOutput = 329 NSString* appOutput =
326 [dataPath stringByAppendingPathComponent:stdioPath_]; 330 [dataPath stringByAppendingPathComponent:stdioPath_];
327 simio = [NSFileHandle fileHandleForReadingAtPath:appOutput]; 331 simio = [NSFileHandle fileHandleForReadingAtPath:appOutput];
328 } 332 }
329 #endif // IOSSIM_USE_XCODE_6 333 #endif // IOSSIM_USE_XCODE_6
330 } 334 }
331 NSFileHandle* standardOutput = [NSFileHandle fileHandleWithStandardOutput]; 335 NSFileHandle* standardOutput = [NSFileHandle fileHandleWithStandardOutput];
332 // Copy data to stdout/stderr while the app is running. 336 // Copy data to stdout/stderr while the app is running.
333 while (appRunning_) { 337 while (appRunning_) {
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 [error localizedDescription], 1012 [error localizedDescription],
1009 [error domain], static_cast<long int>([error code])); 1013 [error domain], static_cast<long int>([error code]));
1010 } 1014 }
1011 1015
1012 // Note that this code is only executed if the simulator fails to start 1016 // Note that this code is only executed if the simulator fails to start
1013 // because once the main run loop is started, only the delegate calling 1017 // because once the main run loop is started, only the delegate calling
1014 // exit() will end the program. 1018 // exit() will end the program.
1015 [pool drain]; 1019 [pool drain];
1016 return kExitFailure; 1020 return kExitFailure;
1017 } 1021 }
OLDNEW
« no previous file with comments | « testing/gmock.gyp ('k') | testing/scripts/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698