tests: Fix URLRequestTest failure with ReduceAcceptLanguage trial

This commit is contained in:
Marshall Greenblatt 2024-05-31 22:53:09 -04:00
parent 15c7e80e3c
commit 39cafe3e6c
1 changed files with 10 additions and 2 deletions

View File

@ -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());