Sync gtest/gmock with Chromium's copy.
Copy over relevant files that are in Chromium's googletest, but not
PDFium's. Delete references to files that no longer exist. With these
changes, testing/gtest can pass "gn check".
Bug: pdfium:1580
Change-Id: Ia56857197c55a6fe55f26b7de91ccd9f37164730
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/72991
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/testing/gtest/include/gtest/gtest-death-test.h b/testing/gtest/include/gtest/gtest-death-test.h
new file mode 100644
index 0000000..eba334a
--- /dev/null
+++ b/testing/gtest/include/gtest/gtest-death-test.h
@@ -0,0 +1,10 @@
+// Copyright 2020 The 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.
+
+// The file/directory layout of Google Test is not yet considered stable. Until
+// it stabilizes, PDFium code will use forwarding headers in testing/gtest
+// and testing/gmock, instead of directly including files in
+// third_party/googletest.
+
+#include "third_party/googletest/src/googletest/include/gtest/gtest-death-test.h"
diff --git a/testing/gtest/include/gtest/gtest-message.h b/testing/gtest/include/gtest/gtest-message.h
new file mode 100644
index 0000000..f7a94b2
--- /dev/null
+++ b/testing/gtest/include/gtest/gtest-message.h
@@ -0,0 +1,10 @@
+// Copyright 2020 The 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.
+
+// The file/directory layout of Google Test is not yet considered stable. Until
+// it stabilizes, PDFium code will use forwarding headers in testing/gtest
+// and testing/gmock, instead of directly including files in
+// third_party/googletest.
+
+#include "third_party/googletest/src/googletest/include/gtest/gtest-message.h"
diff --git a/testing/gtest/include/gtest/gtest-param-test.h b/testing/gtest/include/gtest/gtest-param-test.h
new file mode 100644
index 0000000..6395fd5
--- /dev/null
+++ b/testing/gtest/include/gtest/gtest-param-test.h
@@ -0,0 +1,10 @@
+// Copyright 2020 The 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.
+
+// The file/directory layout of Google Test is not yet considered stable. Until
+// it stabilizes, PDFium code will use forwarding headers in testing/gtest
+// and testing/gmock, instead of directly including files in
+// third_party/googletest.
+
+#include "third_party/googletest/src/googletest/include/gtest/gtest-param-test.h"
diff --git a/testing/gtest/include/gtest/gtest-spi.h b/testing/gtest/include/gtest/gtest-spi.h
new file mode 100644
index 0000000..8a70161
--- /dev/null
+++ b/testing/gtest/include/gtest/gtest-spi.h
@@ -0,0 +1,10 @@
+// Copyright 2020 The 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.
+
+// The file/directory layout of Google Test is not yet considered stable. Until
+// it stabilizes, PDFium code will use forwarding headers in testing/gtest
+// and testing/gmock, instead of directly including files in
+// third_party/googletest.
+
+#include "third_party/googletest/src/googletest/include/gtest/gtest-spi.h"
diff --git a/testing/gtest/include/gtest/gtest.h b/testing/gtest/include/gtest/gtest.h
index 9425b25..11e44ae 100644
--- a/testing/gtest/include/gtest/gtest.h
+++ b/testing/gtest/include/gtest/gtest.h
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
-// it stabilizes, Chromium code will use forwarding headers in testing/gtest
+// it stabilizes, PDFium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
diff --git a/testing/gtest/include/gtest/gtest_prod.h b/testing/gtest/include/gtest/gtest_prod.h
index 2d67b42..1739228 100644
--- a/testing/gtest/include/gtest/gtest_prod.h
+++ b/testing/gtest/include/gtest/gtest_prod.h
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// The file/directory layout of Google Test is not yet considered stable. Until
-// it stabilizes, Chromium code will use forwarding headers in testing/gtest
+// it stabilizes, PDFium code will use forwarding headers in testing/gtest
// and testing/gmock, instead of directly including files in
// third_party/googletest.
diff --git a/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn
index dbfc334..d373e1d 100644
--- a/third_party/googletest/BUILD.gn
+++ b/third_party/googletest/BUILD.gn
@@ -23,7 +23,10 @@
]
# Gtest headers need to be able to find themselves.
- include_dirs = [ "src/googletest/include" ]
+ include_dirs = [
+ "custom",
+ "src/googletest/include",
+ ]
if (is_win) {
cflags = [ "/wd4800" ] # Unused variable warning.
@@ -43,6 +46,15 @@
source_set("gtest") {
testonly = true
sources = [
+ "custom/gtest/internal/custom/gtest.h",
+ "custom/gtest/internal/custom/stack_trace_getter.cc",
+ "custom/gtest/internal/custom/stack_trace_getter.h",
+
+ # TODO(crbug.com/1009553): Remove this wrapper and custom temp dir
+ # after plumbing a workable temporary path into googletest on Android.
+ "custom/gtest/internal/custom/gtest_port_wrapper.cc",
+ "custom/gtest/internal/custom/pdfium_custom_temp_dir.cc",
+ "custom/gtest/internal/custom/pdfium_custom_temp_dir.h",
"src/googletest/include/gtest/gtest-death-test.h",
"src/googletest/include/gtest/gtest-matchers.h",
"src/googletest/include/gtest/gtest-message.h",
@@ -53,15 +65,18 @@
"src/googletest/include/gtest/gtest-typed-test.h",
"src/googletest/include/gtest/gtest.h",
"src/googletest/include/gtest/gtest_pred_impl.h",
+ "src/googletest/include/gtest/gtest_prod.h",
+
+ #"src/googletest/include/gtest/internal/custom/gtest.h", # Superseded.
+ "src/googletest/include/gtest/internal/custom/gtest-port.h",
+ "src/googletest/include/gtest/internal/custom/gtest-printers.h",
"src/googletest/include/gtest/internal/gtest-death-test-internal.h",
"src/googletest/include/gtest/internal/gtest-filepath.h",
"src/googletest/include/gtest/internal/gtest-internal.h",
- "src/googletest/include/gtest/internal/gtest-linked_ptr.h",
- "src/googletest/include/gtest/internal/gtest-param-util-generated.h",
"src/googletest/include/gtest/internal/gtest-param-util.h",
+ "src/googletest/include/gtest/internal/gtest-port-arch.h",
"src/googletest/include/gtest/internal/gtest-port.h",
"src/googletest/include/gtest/internal/gtest-string.h",
- "src/googletest/include/gtest/internal/gtest-tuple.h",
"src/googletest/include/gtest/internal/gtest-type-util.h",
#"src/googletest/src/gtest-all.cc", # Not needed by our build.
@@ -69,7 +84,11 @@
"src/googletest/src/gtest-filepath.cc",
"src/googletest/src/gtest-internal-inl.h",
"src/googletest/src/gtest-matchers.cc",
- "src/googletest/src/gtest-port.cc",
+
+ # gtest_port_wrapper.cc is used instead of gtest-port.cc.
+ # TODO(crbug.com/1009553): Re-enable this file after plumbing a workable
+ # temporary path into googletest on Android.
+ #"src/googletest/src/gtest-port.cc",
"src/googletest/src/gtest-printers.cc",
"src/googletest/src/gtest-test-part.cc",
"src/googletest/src/gtest-typed-test.cc",
@@ -79,10 +98,16 @@
# Some files include "src/gtest-internal-inl.h".
include_dirs = [ "src/googletest" ]
- all_dependent_configs = [ ":gtest_config" ]
+ public_configs = [ ":gtest_config" ]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
+
+ defines = [ "GTEST_DISABLE_PRINT_STACK_TRACE" ]
+ sources -= [
+ "custom/gtest/internal/custom/stack_trace_getter.cc",
+ "custom/gtest/internal/custom/stack_trace_getter.h",
+ ]
}
# Do NOT depend on this directly. Use //testing/gtest:gtest_main instead.
@@ -100,16 +125,21 @@
sources = [
"src/googlemock/include/gmock/gmock-actions.h",
"src/googlemock/include/gmock/gmock-cardinalities.h",
+ "src/googlemock/include/gmock/gmock-function-mocker.h",
"src/googlemock/include/gmock/gmock-generated-actions.h",
- "src/googlemock/include/gmock/gmock-generated-function-mockers.h",
- "src/googlemock/include/gmock/gmock-generated-matchers.h",
- "src/googlemock/include/gmock/gmock-generated-nice-strict.h",
"src/googlemock/include/gmock/gmock-matchers.h",
+ "src/googlemock/include/gmock/gmock-more-actions.h",
+ "src/googlemock/include/gmock/gmock-more-matchers.h",
+ "src/googlemock/include/gmock/gmock-nice-strict.h",
"src/googlemock/include/gmock/gmock-spec-builders.h",
"src/googlemock/include/gmock/gmock.h",
- "src/googlemock/include/gmock/internal/gmock-generated-internal-utils.h",
+
+ #"src/googlemock/include/gmock/internal/custom/gmock-port.h", # Superseded.
+ "src/googlemock/include/gmock/internal/custom/gmock-generated-actions.h",
+ "src/googlemock/include/gmock/internal/custom/gmock-matchers.h",
"src/googlemock/include/gmock/internal/gmock-internal-utils.h",
"src/googlemock/include/gmock/internal/gmock-port.h",
+ "src/googlemock/include/gmock/internal/gmock-pp.h",
# gmock helpers.
"custom/gmock/internal/custom/gmock-port.h",
@@ -122,10 +152,9 @@
"src/googlemock/src/gmock.cc",
]
- public_configs = [
- ":gmock_config",
- ":gtest_config",
- ]
+ public_deps = [ ":gtest" ]
+
+ public_configs = [ ":gmock_config" ]
}
# Do NOT depend on this directly. Use //testing/gmock:gmock_main instead.
diff --git a/third_party/googletest/custom/gmock/internal/custom/gmock-port.h b/third_party/googletest/custom/gmock/internal/custom/gmock-port.h
new file mode 100644
index 0000000..ed8a07f
--- /dev/null
+++ b/third_party/googletest/custom/gmock/internal/custom/gmock-port.h
@@ -0,0 +1,25 @@
+// Copyright 2020 The 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 THIRD_PARTY_GOOGLETEST_CUSTOM_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+#define THIRD_PARTY_GOOGLETEST_CUSTOM_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+
+#include <type_traits>
+
+namespace std {
+
+// Provide alternative implementation of std::is_default_constructible for
+// old, pre-4.7 of libstdc++, where is_default_constructible is missing.
+// <20120322 below implies pre-4.7.0. In addition we blacklist several version
+// that released after 4.7.0 from pre-4.7.0 branch. 20120702 implies 4.5.4, and
+// 20121127 implies 4.6.4.
+#if defined(__GLIBCXX__) && \
+ (__GLIBCXX__ < 20120322 || __GLIBCXX__ == 20120702 || \
+ __GLIBCXX__ == 20121127)
+template <typename T>
+using is_default_constructible = std::is_constructible<T>;
+#endif
+}
+
+#endif // THIRD_PARTY_GOOGLETEST_CUSTOM_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
diff --git a/third_party/googletest/custom/gtest/internal/custom/gtest.h b/third_party/googletest/custom/gtest/internal/custom/gtest.h
new file mode 100644
index 0000000..9409de6
--- /dev/null
+++ b/third_party/googletest/custom/gtest/internal/custom/gtest.h
@@ -0,0 +1,23 @@
+// Copyright 2020 The 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 THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_GTEST_H_
+#define THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_GTEST_H_
+
+#include "build/build_config.h"
+#include "third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.h"
+
+#if !defined(GTEST_DISABLE_PRINT_STACK_TRACE)
+#include "third_party/googletest/custom/gtest/internal/custom/stack_trace_getter.h"
+
+// Tell Google Test to use a stack trace getter based on Chromium's
+// base::debug::StackTrace.
+#define GTEST_OS_STACK_TRACE_GETTER_ StackTraceGetter
+#endif // defined(GTEST_DISABLE_PRINT_STACK_TRACE)
+
+// TODO(crbug.com/1009553): Remove once googletest android temporary path is
+// fixed.
+#define GTEST_CUSTOM_TEMPDIR_FUNCTION_ ChromeCustomTempDir
+
+#endif // THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_GTEST_H_
diff --git a/third_party/googletest/custom/gtest/internal/custom/gtest_port_wrapper.cc b/third_party/googletest/custom/gtest/internal/custom/gtest_port_wrapper.cc
new file mode 100644
index 0000000..77e297e
--- /dev/null
+++ b/third_party/googletest/custom/gtest/internal/custom/gtest_port_wrapper.cc
@@ -0,0 +1,151 @@
+// Copyright 2020 The 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.
+
+// TODO(crbug.com/1009553): Remove this wrapper after finding a way to plumb a
+// workable temporary path into googletest on Android.
+
+// This wrapper lets us compile gtest-port.cc without its stream redirection
+// code. We replace this code with a variant that works on all Chrome platforms.
+// This is a temporary workaround until we get good code upstream.
+//
+// Stream redirection requires the ability to create files in a temporary
+// directory. Traditionally, this directory has been /sdcard on Android.
+// Commit bf0fe874a27bd6c9a4a35b98e662d2d02f8879a2 changed the Android
+// directory to /data/local/tmp, which is not writable in Chrome's testing
+// setup. We work around this problem by using the old code for now.
+//
+// It is tempting to consider disabling the stream redirection code altogether,
+// by setting GTEST_HAS_STREAM_REDIRECTION to 0 in googletest's BUILD.gn.
+// This breaks gtest-death-test.cc, which assumes the existence of
+// testing::internal::{GetCapturedStderr,CaptureStderr} without any macro
+// checking.
+
+#define GTEST_HAS_STREAM_REDIRECTION 0
+#include "third_party/googletest/src/googletest/src/gtest-port.cc"
+
+namespace testing {
+namespace internal {
+
+// Object that captures an output stream (stdout/stderr).
+class CapturedStream {
+ public:
+ // The ctor redirects the stream to a temporary file.
+ explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
+ std::string temp_dir = ::testing::TempDir();
+
+ // testing::TempDir() should return a directory with a path separator.
+ // However, this rule was documented fairly recently, so we normalize across
+ // implementations with and without a trailing path separator.
+ if (temp_dir.back() != GTEST_PATH_SEP_[0])
+ temp_dir.push_back(GTEST_PATH_SEP_[0]);
+
+#if GTEST_OS_WINDOWS
+ char temp_file_path[MAX_PATH + 1] = {'\0'}; // NOLINT
+ const UINT success = ::GetTempFileNameA(temp_dir.c_str(), "gtest_redir",
+ 0, // Generate unique file name.
+ temp_file_path);
+ GTEST_CHECK_(success != 0)
+ << "Unable to create a temporary file in " << temp_dir;
+ const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
+ GTEST_CHECK_(captured_fd != -1)
+ << "Unable to open temporary file " << temp_file_path;
+ filename_ = temp_file_path;
+#else
+ std::string name_template = temp_dir + "gtest_captured_stream.XXXXXX";
+
+ // mkstemp() modifies the string bytes in place, and does not go beyond the
+ // string's length. This results in well-defined behavior in C++17.
+ //
+ // The const_cast is needed below C++17. The constraints on std::string
+ // implementations in C++11 and above make assumption behind the const_cast
+ // fairly safe.
+ const int captured_fd = ::mkstemp(const_cast<char*>(name_template.data()));
+ GTEST_CHECK_(captured_fd != -1)
+ << "Failed to create tmp file " << name_template
+ << " for test; does the test have write access to the directory?";
+ filename_ = std::move(name_template);
+#endif // GTEST_OS_WINDOWS
+ fflush(nullptr);
+ dup2(captured_fd, fd_);
+ close(captured_fd);
+ }
+
+ ~CapturedStream() { remove(filename_.c_str()); }
+
+ std::string GetCapturedString() {
+ if (uncaptured_fd_ != -1) {
+ // Restores the original stream.
+ fflush(nullptr);
+ dup2(uncaptured_fd_, fd_);
+ close(uncaptured_fd_);
+ uncaptured_fd_ = -1;
+ }
+
+ FILE* const file = posix::FOpen(filename_.c_str(), "r");
+ if (file == nullptr) {
+ GTEST_LOG_(FATAL) << "Failed to open tmp file " << filename_
+ << " for capturing stream.";
+ }
+ const std::string content = ReadEntireFile(file);
+ posix::FClose(file);
+ return content;
+ }
+
+ private:
+ const int fd_; // A stream to capture.
+ int uncaptured_fd_;
+ // Name of the temporary file holding the stderr output.
+ ::std::string filename_;
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
+};
+
+GTEST_DISABLE_MSC_DEPRECATED_POP_()
+
+static CapturedStream* g_captured_stderr = nullptr;
+static CapturedStream* g_captured_stdout = nullptr;
+
+// Starts capturing an output stream (stdout/stderr).
+static void CaptureStream(int fd,
+ const char* stream_name,
+ CapturedStream** stream) {
+ if (*stream != nullptr) {
+ GTEST_LOG_(FATAL) << "Only one " << stream_name
+ << " capturer can exist at a time.";
+ }
+ *stream = new CapturedStream(fd);
+}
+
+// Stops capturing the output stream and returns the captured string.
+static std::string GetCapturedStream(CapturedStream** captured_stream) {
+ const std::string content = (*captured_stream)->GetCapturedString();
+
+ delete *captured_stream;
+ *captured_stream = nullptr;
+
+ return content;
+}
+
+// Starts capturing stdout.
+void CaptureStdout() {
+ CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);
+}
+
+// Starts capturing stderr.
+void CaptureStderr() {
+ CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);
+}
+
+// Stops capturing stdout and returns the captured string.
+std::string GetCapturedStdout() {
+ return GetCapturedStream(&g_captured_stdout);
+}
+
+// Stops capturing stderr and returns the captured string.
+std::string GetCapturedStderr() {
+ return GetCapturedStream(&g_captured_stderr);
+}
+
+} // namespace internal
+} // namespace testing
diff --git a/third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.cc b/third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.cc
new file mode 100644
index 0000000..6cc6c83
--- /dev/null
+++ b/third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.cc
@@ -0,0 +1,82 @@
+// Copyright 2020 The 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.
+
+#include "third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.h"
+#include "third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h"
+#if GTEST_OS_WINDOWS
+#include <windows.h>
+#endif // GTEST_OS_WINDOWS
+
+namespace testing {
+
+namespace {
+
+// The temporary directory read from the OS canonical environment variable.
+//
+// Returns an empty string if the environment variable is not set. The returned
+// string may or may not end with the OS-specific path separator. The path is
+// not guaranteed to point to an existing directory. The directory it points to
+// is not guaranteed to be writable by the application.
+std::string ChromeGetEnvTempDir() {
+#if GTEST_OS_WINDOWS_MOBILE
+ const char* env_result = internal::posix::GetEnv("TEMP");
+#elif GTEST_OS_WINDOWS
+ char temp_dir_path[_MAX_PATH + 1] = {'\0'}; // NOLINT
+ if (::GetTempPathA(sizeof(temp_dir_path), temp_dir_path) != 0)
+ return temp_dir_path;
+ const char* env_result = internal::posix::GetEnv("TEMP");
+#else
+ const char* env_result = internal::posix::GetEnv("TMPDIR");
+#endif // GETST_OS_WINDOWS
+
+ if (env_result == nullptr)
+ return std::string();
+ return env_result;
+}
+
+} // namespace
+
+// returns temp directory for tests.
+std::string ChromeCustomTempDir() {
+ std::string temp_dir = ChromeGetEnvTempDir();
+ if (!temp_dir.empty()) {
+ if (temp_dir.back() != GTEST_PATH_SEP_[0])
+ temp_dir.push_back(GTEST_PATH_SEP_[0]);
+ return temp_dir;
+ }
+
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS
+ return "\\temp\\";
+#elif GTEST_OS_LINUX_ANDROID
+ // Android applications are expected to call the framework's
+ // Context.getExternalStorageDirectory() method through JNI to get the
+ // location of the world-writable SD Card directory. However, this requires a
+ // Context handle, which cannot be retrieved globally from native code. Doing
+ // so also precludes running the code as part of a regular standalone
+ // executable, which doesn't run in a Dalvik process (e.g. when running it
+ // through 'adb shell').
+ //
+ // Starting from Android O, the recommended generic temporary directory is
+ // '/data/local/tmp'. The recommended fallback is the current directory,
+ // which is usually accessible in app context.
+ if (::access("/data/local/tmp", R_OK | W_OK | X_OK) == 0)
+ return "/data/local/tmp/";
+ const char* current_dir = ::getcwd(nullptr, 0);
+ if (current_dir != nullptr &&
+ ::access(current_dir, R_OK | W_OK | X_OK) == 0) {
+ temp_dir = current_dir;
+ temp_dir.push_back(GTEST_PATH_SEP_[0]);
+ return temp_dir;
+ }
+ // Before Android O, /sdcard is usually available.
+ if (::access("/sdcard", R_OK | W_OK | X_OK) == 0)
+ return "/sdcard/";
+ // Generic POSIX fallback.
+ return "/tmp/";
+#else
+ return "/tmp/";
+#endif // GTEST_OS_WINDOWS_MOBILE
+}
+
+} // namespace testing
diff --git a/third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.h b/third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.h
new file mode 100644
index 0000000..647a036
--- /dev/null
+++ b/third_party/googletest/custom/gtest/internal/custom/pdfium_custom_temp_dir.h
@@ -0,0 +1,15 @@
+// Copyright 2020 The 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 THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_CHROME_CUSTOM_TEMP_DIR_H_
+#define THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_CHROME_CUSTOM_TEMP_DIR_H_
+
+#include <string>
+
+namespace testing {
+// Returns alternate temp directory for gtest.
+std::string ChromeCustomTempDir();
+} // namespace testing
+
+#endif // THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_CHROME_CUSTOM_TEMP_DIR_H_