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

Unified Diff: testing/utils/path_service.h

Issue 1408003014: Retrieve test data directory at run time (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix headers Created 5 years, 1 month 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
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_

Powered by Google App Engine
This is Rietveld 408576698