From 39cafe3e6cc4cf19b5bdde4080a3bcebd5f0df91 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 31 May 2024 22:53:09 -0400 Subject: [PATCH] tests: Fix URLRequestTest failure with ReduceAcceptLanguage trial --- tests/ceftests/urlrequest_unittest.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/ceftests/urlrequest_unittest.cc b/tests/ceftests/urlrequest_unittest.cc index 4bb39f1f8..0d6d50d6e 100644 --- a/tests/ceftests/urlrequest_unittest.cc +++ b/tests/ceftests/urlrequest_unittest.cc @@ -15,6 +15,7 @@ #include "include/cef_task.h" #include "include/cef_urlrequest.h" #include "include/cef_waitable_event.h" +#include "include/test/cef_test_helpers.h" #include "include/wrapper/cef_closure_task.h" #include "include/wrapper/cef_scoped_temp_dir.h" #include "tests/ceftests/test_handler.h" @@ -473,8 +474,15 @@ void VerifyNormalRequest(const RequestRunSettings* settings, // CEF_SETTINGS_ACCEPT_LANGUAGE value from CefSettings.accept_language_list // set in CefTestSuite::GetSettings() and expanded internally by // ComputeAcceptLanguageFromPref. - EXPECT_STREQ("en-GB,en;q=0.9", - GetHeaderValue(headerMap, "accept-language").c_str()); + const std::string& accept_language = + GetHeaderValue(headerMap, "accept-language"); + if (CefIsFeatureEnabledForTests("ReduceAcceptLanguage")) { + EXPECT_TRUE(accept_language == "en-GB" || + accept_language == "en-GB,en;q=0.9") + << accept_language; + } else { + EXPECT_STREQ("en-GB,en;q=0.9", accept_language.data()); + } if (server_backend) { EXPECT_FALSE(GetHeaderValue(headerMap, "accept-encoding").empty());