OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 namespace webrtc { | 69 namespace webrtc { |
70 namespace test { | 70 namespace test { |
71 | 71 |
72 // This is the "directory" returned if the ProjectPath() function fails | 72 // This is the "directory" returned if the ProjectPath() function fails |
73 // to find the project root. | 73 // to find the project root. |
74 extern const char* kCannotFindProjectRootDir; | 74 extern const char* kCannotFindProjectRootDir; |
75 | 75 |
76 // Finds the root dir of the project, to be able to set correct paths to | 76 // Finds the root dir of the project, to be able to set correct paths to |
77 // resource files used by tests. | 77 // resource files used by tests. |
78 // The implementation is simple: it just looks for the file defined by | 78 // For desktop, we assume that the project root is two levels above (i.e. the |
79 // kProjectRootFileName, starting in the current directory (the working | 79 // current working directory + /../../) |
80 // directory) and then steps upward until it is found (or it is at the root of | 80 // For Android, it is assumed to be /sdcard/chromium_tests_root/ |
81 // the file system). | 81 // For iOS, the resource files are assumed to be included in the test's .app |
| 82 // bundle. |
82 // If the current working directory is above the project root dir, it will not | 83 // If the current working directory is above the project root dir, it will not |
83 // be found. | 84 // be found. |
84 // | 85 // |
85 // If symbolic links occur in the path they will be resolved and the actual | 86 // If symbolic links occur in the path they will be resolved and the actual |
86 // directory will be returned. | 87 // directory will be returned. |
87 // | 88 // |
88 // Returns the absolute path to the project root dir (usually the trunk dir) | 89 // Returns the absolute path to the project root dir (usually the trunk dir) |
89 // WITH a trailing path delimiter. | 90 // WITH a trailing path delimiter. |
90 // If the project root is not found, the string specified by | 91 // If the project root is not found, the string specified by |
91 // kCannotFindProjectRootDir is returned. | 92 // kCannotFindProjectRootDir is returned. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // but can also be an absolute path. The intention with this function is to pass | 151 // but can also be an absolute path. The intention with this function is to pass |
151 // the argv[0] being sent into the main function to make it possible for | 152 // the argv[0] being sent into the main function to make it possible for |
152 // fileutils.h to find the correct project paths even when the working directory | 153 // fileutils.h to find the correct project paths even when the working directory |
153 // is outside the project tree (which happens in some cases). | 154 // is outside the project tree (which happens in some cases). |
154 void SetExecutablePath(const std::string& path_to_executable); | 155 void SetExecutablePath(const std::string& path_to_executable); |
155 | 156 |
156 } // namespace test | 157 } // namespace test |
157 } // namespace webrtc | 158 } // namespace webrtc |
158 | 159 |
159 #endif // WEBRTC_TEST_TESTSUPPORT_FILEUTILS_H_ | 160 #endif // WEBRTC_TEST_TESTSUPPORT_FILEUTILS_H_ |
OLD | NEW |