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

Unified Diff: third_party/protobuf/src/google/protobuf/testing/googletest.cc

Issue 1322483002: Revert https://codereview.chromium.org/1291903002 (protobuf roll). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
Index: third_party/protobuf/src/google/protobuf/testing/googletest.cc
diff --git a/third_party/protobuf/src/google/protobuf/testing/googletest.cc b/third_party/protobuf/src/google/protobuf/testing/googletest.cc
index b8bd790b668362921efbd8f9e553f9ad3d579dda..a8da6b1d129987ae359d543c68c62553e5d1f903 100644
--- a/third_party/protobuf/src/google/protobuf/testing/googletest.cc
+++ b/third_party/protobuf/src/google/protobuf/testing/googletest.cc
@@ -1,6 +1,6 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
-// https://developers.google.com/protocol-buffers/
+// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -65,15 +65,7 @@ namespace protobuf {
#endif
string TestSourceDir() {
-#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
-#ifndef _MSC_VER
- // automake sets the "srcdir" environment variable.
- char* result = getenv("srcdir");
- if (result != NULL) {
- return result;
- }
-#endif // _MSC_VER
-
+#ifdef _MSC_VER
// Look for the "src" directory.
string prefix = ".";
@@ -87,8 +79,15 @@ string TestSourceDir() {
}
return prefix + "/src";
#else
- return "third_party/protobuf/src";
-#endif // GOOGLE_THIRD_PARTY_PROTOBUF
+ // automake sets the "srcdir" environment variable.
+ char* result = getenv("srcdir");
+ if (result == NULL) {
+ // Otherwise, the test must be run from the source directory.
+ return ".";
+ } else {
+ return result;
+ }
+#endif
}
namespace {
@@ -105,10 +104,6 @@ string GetTemporaryDirectoryName() {
if (HasPrefixString(result, "\\")) {
result.erase(0, 1);
}
- // The Win32 API accepts forward slashes as a path delimiter even though
- // backslashes are standard. Let's avoid confusion and use only forward
- // slashes.
- result = StringReplace(result, "\\", "/", true);
#endif // _WIN32
return result;
}

Powered by Google App Engine
This is Rietveld 408576698