From 70e535e0b278d1eda5d09b1de3119bf538166ac3 Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Tue, 5 Mar 2024 17:38:24 +0000 Subject: [PATCH] Use macro for google test flags GTest is getting updated and the way how flags are set has also been changed to be through a macro. This change corrects the remaining offending code to make use of this macro. Chromium change: https://chromium.googlesource.com/chromium/src/+/7f4b01bd3e8e61957bd6a85ee913b924061f5978 commit 7f4b01bd3e8e61957bd6a85ee913b924061f5978 Author: Daniel Cheng Date: Sat Feb 24 10:16:02 2024 +0000 Roll src/third_party/googletest/src/ af29db7ec..76bb2afb8 (375 commits) This roll includes several fixes needed to unblock the automated roll. In particular, the biggest change is disabling Abseil support in GoogleTest: GoogleTest has switched to using Abseil flags when GTEST_HAS_ABSL is set, which is incompatible with Chrome. For Chrome, the main impact of disabling Abseil support is losing the pretty printer for absl::variant; however, Chrome plans to switch to std::variant once the codegen issues are fixed. Unfortunately, this also requires suppressing GN check for GoogleTest to prevent errors from false positives, since GN does not understand conditional includes and does not realize that the Abseil flags headers are not actually included. Created with: roll-dep src/third_party/googletest/src Bug: 1409870 --- .../brave_rewards/core/publisher/media/youtube_unittest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/brave_rewards/core/publisher/media/youtube_unittest.cc b/components/brave_rewards/core/publisher/media/youtube_unittest.cc index 698d30059927..76eff217aa9c 100644 --- a/components/brave_rewards/core/publisher/media/youtube_unittest.cc +++ b/components/brave_rewards/core/publisher/media/youtube_unittest.cc @@ -433,7 +433,7 @@ TEST(MediaYouTubeTest, GetVideoUrl) { // https://source.chromium.org/chromium/chromium/src/+/master:base/test/gtest_util.h;l=23 // Death tests misbehave on Android. #if !BUILDFLAG(IS_ANDROID) - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + GTEST_FLAG_SET(death_test_style, "threadsafe"); EXPECT_DEATH({ YouTube::GetVideoUrl(media_id); }, "Check failed: !media_id.empty*"); #endif // !BUILDFLAG(IS_ANDROID) @@ -469,7 +469,7 @@ TEST(MediaYouTubeTest, GetChannelUrl) { // https://source.chromium.org/chromium/chromium/src/+/master:base/test/gtest_util.h;l=23 // Death tests misbehave on Android. #if !BUILDFLAG(IS_ANDROID) - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + GTEST_FLAG_SET(death_test_style, "threadsafe"); EXPECT_DEATH({ YouTube::GetChannelUrl(channel_id); }, "Check failed: !publisher_key.empty*"); #endif // !BUILDFLAG(IS_ANDROID)