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

Side by Side Diff: webrtc/test/testsupport/iosfileutils.mm

Issue 1694353003: iOS: Add resource files for tests and implement OutputPath (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix ifdef for Android build Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « webrtc/test/testsupport/fileutils.cc ('k') | webrtc/webrtc_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 NSString* path = NSStringFromStdString(name); 47 NSString* path = NSStringFromStdString(name);
48 NSString* fileName = path.lastPathComponent; 48 NSString* fileName = path.lastPathComponent;
49 NSString* fileType = NSStringFromStdString(extension); 49 NSString* fileType = NSStringFromStdString(extension);
50 // Get full pathname for the resource identified by the name and extension. 50 // Get full pathname for the resource identified by the name and extension.
51 NSString* pathString = [[NSBundle mainBundle] pathForResource:fileName 51 NSString* pathString = [[NSBundle mainBundle] pathForResource:fileName
52 ofType:fileType]; 52 ofType:fileType];
53 return StdStringFromNSString(pathString); 53 return StdStringFromNSString(pathString);
54 } 54 }
55 } 55 }
56 56
57 // For iOS, we don't have access to the output directory. Return the path to the
58 // temporary directory instead. This is mostly used by tests that need to write
59 // output files to disk.
60 std::string IOSOutputPath() {
61 @autoreleasepool {
62 NSString* tempDir = NSTemporaryDirectory();
63 if (tempDir == nil)
64 tempDir = @"/tmp";
65 return StdStringFromNSString(tempDir);
66 }
67 }
68
57 } // namespace test 69 } // namespace test
58 } // namespace webrtc 70 } // namespace webrtc
59 71
60 #endif // defined(WEBRTC_IOS) 72 #endif // defined(WEBRTC_IOS)
OLDNEW
« no previous file with comments | « webrtc/test/testsupport/fileutils.cc ('k') | webrtc/webrtc_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698