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

Unified Diff: webrtc/test/testsupport/fileutils.cc

Issue 1178843002: Adds support for webrtc::test::ResourcePath on iOS (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nits Created 5 years, 6 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/test.gyp ('k') | webrtc/test/testsupport/iosfileutils.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/testsupport/fileutils.cc
diff --git a/webrtc/test/testsupport/fileutils.cc b/webrtc/test/testsupport/fileutils.cc
index 8301e77165d2e1e2d4214db876b9d7fd413bb99e..c29e5024331b3123f9e7d159f9a1deafdd804261 100644
--- a/webrtc/test/testsupport/fileutils.cc
+++ b/webrtc/test/testsupport/fileutils.cc
@@ -41,6 +41,11 @@
namespace webrtc {
namespace test {
+#if defined(WEBRTC_IOS)
+// Defined in iosfileutils.mm. No header file to discourage use elsewhere.
+std::string IOSResourcePath(std::string name, std::string extension);
+#endif
+
namespace {
#ifdef WIN32
@@ -57,7 +62,9 @@ const char* kProjectRootFileName = "DEPS";
const char* kOutputDirName = "out";
const char* kFallbackPath = "./";
#endif
+#if !defined(WEBRTC_IOS)
const char* kResourcesDirName = "resources";
+#endif
char relative_dir_path[FILENAME_MAX];
bool relative_dir_path_set = false;
@@ -205,6 +212,9 @@ bool CreateDir(std::string directory_name) {
}
std::string ResourcePath(std::string name, std::string extension) {
+#if defined(WEBRTC_IOS)
+ return IOSResourcePath(name, extension);
+#else
std::string platform = "win";
#ifdef WEBRTC_LINUX
platform = "linux";
@@ -239,6 +249,7 @@ std::string ResourcePath(std::string name, std::string extension) {
// Fall back on name without architecture or platform.
return resources_path + name + "." + extension;
+#endif // defined (WEBRTC_IOS)
}
size_t GetFileSize(std::string filename) {
« no previous file with comments | « webrtc/test/test.gyp ('k') | webrtc/test/testsupport/iosfileutils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698