Chromium Code Reviews| Index: testing/utils/path_service.h |
| diff --git a/testing/utils/path_service.h b/testing/utils/path_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e36c6f550b4dfed9ff47593dd11e308a0a7a10b1 |
| --- /dev/null |
| +++ b/testing/utils/path_service.h |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2015 PDFium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef TESTING_UTILS_PATH_SERVICE_H_ |
| +#define TESTING_UTILS_PATH_SERVICE_H_ |
| + |
| +#include <string> |
| + |
| +#ifdef _WIN32 |
| +#define PATH_SEPARATOR '\\' |
| +#else |
| +#define PATH_SEPARATOR '/' |
| +#endif |
| + |
| +// Get the various file directory and path information. |
| +class PathService { |
| + public: |
| + static bool EndsWithSeparator(const std::string& path); |
|
Lei Zhang
2015/11/07 01:48:51
Comments please.
Wei Li
2015/11/07 02:36:12
Done.
|
| + static bool GetExecutableDir(std::string* path); |
|
Lei Zhang
2015/11/07 01:48:51
Can this return a string, with an empty string as
Wei Li
2015/11/07 02:36:12
Yes, it can. But we would need to write special co
Lei Zhang
2015/11/07 02:43:30
We use it in a few places. In some ways it's easie
Wei Li
2015/11/09 18:08:19
Acknowledged.
|
| + static bool GetSourceDir(std::string* path); |
| + static bool GetTestDataDir(std::string* path); |
| + // Get the full path for a test file under the test data directory. |
| + static bool GetTestFilePath(const std::string& file_name, std::string* path); |
| +}; |
| +#endif // TESTING_UTILS_PATH_SERVICE_H_ |