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

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

Issue 2340773002: Assume ProjectRootPath() equals ../.. in Desktop (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | 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 4bf8c5fa19178048ec4edda00e001796962a7a66..de5c7355a66d7d56feaf5640b95a6ea2a07be0a5 100644
--- a/webrtc/test/testsupport/fileutils.cc
+++ b/webrtc/test/testsupport/fileutils.cc
@@ -59,8 +59,6 @@ const char* kPathDelimiter = "/";
#ifdef WEBRTC_ANDROID
const char* kRootDirName = "/sdcard/chromium_tests_root/";
#else
-// The file we're looking for to identify the project root dir.
-const char* kProjectRootFileName = "DEPS";
#if !defined(WEBRTC_IOS)
const char* kOutputDirName = "out";
#endif
@@ -125,21 +123,22 @@ std::string ProjectRootPath() {
if (path == kFallbackPath) {
return kCannotFindProjectRootDir;
}
- if (relative_dir_path_set) {
+ if (relative_dir_path_set && strcmp(relative_dir_path, ".") != 0) {
path = path + kPathDelimiter + relative_dir_path;
}
// Check for our file that verifies the root dir.
kjellander_webrtc 2016/09/15 06:28:32 We don't check for a file anymore, do we? I sugges
kjellander_webrtc 2016/09/15 06:28:33 I think a comment phrased something like this is s
ehmaldonado_webrtc 2016/09/15 08:23:15 Done.
size_t path_delimiter_index = path.find_last_of(kPathDelimiter);
- while (path_delimiter_index != std::string::npos) {
- std::string root_filename = path + kPathDelimiter + kProjectRootFileName;
- if (FileExists(root_filename)) {
- return path + kPathDelimiter;
- }
+ if (path_delimiter_index != std::string::npos) {
// Move up one directory in the directory tree.
path = path.substr(0, path_delimiter_index);
path_delimiter_index = path.find_last_of(kPathDelimiter);
+ // Check for our file that verifies the root dir.
kjellander_webrtc 2016/09/15 06:28:33 Remove this comment, it's just confusing.
ehmaldonado_webrtc 2016/09/15 08:23:15 Done.
+ size_t path_delimiter_index = path.find_last_of(kPathDelimiter);
kjellander_webrtc 2016/09/15 06:28:33 Does this even compile? It seems you're declaring
ehmaldonado_webrtc 2016/09/15 08:23:15 Yes, it compiles, and it works. I think maybe it w
+ if (path_delimiter_index != std::string::npos) {
+ // Move up one directory in the directory tree.
kjellander_webrtc 2016/09/15 06:28:32 Change to: // Move up another directory level in t
ehmaldonado_webrtc 2016/09/15 08:23:15 Done.
+ return path.substr(0, path_delimiter_index) + kPathDelimiter;
+ }
}
- // Reached the root directory.
fprintf(stderr, "Cannot find project root directory!\n");
return kCannotFindProjectRootDir;
}
@@ -260,6 +259,8 @@ std::string ResourcePath(std::string name, std::string extension) {
}
// Fall back on name without architecture or platform.
+ resource_file = resources_path + name + "." + extension;
+ FileExists(resource_file);
return resources_path + name + "." + extension;
kjellander_webrtc 2016/09/15 06:28:33 return resource_file;
ehmaldonado_webrtc 2016/09/15 08:23:15 I'm leaving this unchanged. Those two lines were f
kjellander_webrtc 2016/09/15 10:04:49 Acknowledged.
#endif // defined (WEBRTC_IOS)
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698