diff --git a/webrtc/test/testsupport/gtest_prod_util.h b/webrtc/test/testsupport/gtest_prod_util.h index ec3cce6353..989d94d029 100644 --- a/webrtc/test/testsupport/gtest_prod_util.h +++ b/webrtc/test/testsupport/gtest_prod_util.h @@ -12,7 +12,10 @@ #define WEBRTC_TEST_TESTSUPPORT_GTEST_PROD_UTIL_H_ #pragma once -#include "testing/gtest/include/gtest/gtest_prod.h" +// Define our own version of FRIEND_TEST here rather than including +// gtest_prod.h to avoid depending on any part of GTest in production code. +#define FRIEND_TEST_WEBRTC(test_case_name, test_name)\ +friend class test_case_name##_##test_name##_Test // This file is a plain copy of Chromium's base/gtest_prod_util.h. // @@ -28,9 +31,9 @@ // FRIEND_TEST_ALL_PREFIXES(MyClassTest, MyMethod); // }; #define FRIEND_TEST_ALL_PREFIXES(test_case_name, test_name) \ - FRIEND_TEST(test_case_name, test_name); \ - FRIEND_TEST(test_case_name, DISABLED_##test_name); \ - FRIEND_TEST(test_case_name, FLAKY_##test_name); \ - FRIEND_TEST(test_case_name, FAILS_##test_name) + FRIEND_TEST_WEBRTC(test_case_name, test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, DISABLED_##test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, FLAKY_##test_name); \ + FRIEND_TEST_WEBRTC(test_case_name, FAILS_##test_name) #endif // WEBRTC_TEST_TESTSUPPORT_GTEST_PROD_UTIL_H_