Revert "Delete rtc::Pathname"
This reverts commit 6b9dec0d16f2df59fa2820c5ec1341be52fb9f32.
Reason for revert: speculative revert for breaking internal projects
Original change's description:
> Delete rtc::Pathname
>
> Bug: webrtc:6424
> Change-Id: Iec01dc5dd1426d4558983b828b67af872107d723
> Reviewed-on: https://webrtc-review.googlesource.com/c/108400
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25479}
TBR=kwiberg@webrtc.org,nisse@webrtc.org
Change-Id: I3129a81a1d8e36b3e6c67572410bdc478ec4d5e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:6424
Reviewed-on: https://webrtc-review.googlesource.com/c/109201
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25490}
diff --git a/test/testsupport/fileutils.cc b/test/testsupport/fileutils.cc
index a71d8f8..0eac8d5 100644
--- a/test/testsupport/fileutils.cc
+++ b/test/testsupport/fileutils.cc
@@ -64,12 +64,16 @@
namespace webrtc {
namespace test {
+namespace {
+
#if defined(WEBRTC_WIN)
const char* kPathDelimiter = "\\";
#else
const char* kPathDelimiter = "/";
#endif
+} // namespace
+
std::string DirName(const std::string& path) {
if (path.empty())
return "";
diff --git a/test/testsupport/fileutils.h b/test/testsupport/fileutils.h
index 8a18698..693944e 100644
--- a/test/testsupport/fileutils.h
+++ b/test/testsupport/fileutils.h
@@ -25,9 +25,6 @@
// to find the project root.
extern const char* kCannotFindProjectRootDir;
-// Slash or backslash, depending on platform. NUL-terminated string.
-extern const char* kPathDelimiter;
-
// Returns the absolute path to the output directory where log files and other
// test artifacts should be put. The output directory is generally a directory
// named "out" at the project root. This root is assumed to be two levels above
diff --git a/test/testsupport/fileutils_unittest.cc b/test/testsupport/fileutils_unittest.cc
index d39f468..c6dc86d 100644
--- a/test/testsupport/fileutils_unittest.cc
+++ b/test/testsupport/fileutils_unittest.cc
@@ -24,6 +24,9 @@
#ifdef WIN32
#define chdir _chdir
+static const char* kPathDelimiter = "\\";
+#else
+static const char* kPathDelimiter = "/";
#endif
using ::testing::EndsWith;
diff --git a/test/testsupport/test_artifacts_unittest.cc b/test/testsupport/test_artifacts_unittest.cc
index df02d27..267ea93 100644
--- a/test/testsupport/test_artifacts_unittest.cc
+++ b/test/testsupport/test_artifacts_unittest.cc
@@ -16,6 +16,7 @@
#include "rtc_base/file.h"
#include "rtc_base/flags.h"
+#include "rtc_base/pathutils.h"
#include "rtc_base/platform_file.h"
#include "test/gtest.h"
#include "test/testsupport/fileutils.h"