#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/browser/reduce_accept_language/reduce_accept_language_utils.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/test/scoped_feature_list.h"
#include "content/browser/reduce_accept_language/reduce_accept_language_throttle.h"
#include "content/public/browser/reduce_accept_language_controller_delegate.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/test/mock_reduce_accept_language_controller_delegate.h"
#include "content/test/test_render_frame_host.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "net/http/http_response_headers.h"
#include "services/network/public/cpp/avail_language_header_parser.h"
#include "services/network/public/cpp/content_language_parser.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace content {
namespace {
mojo::PendingAssociatedRemote<mojom::Frame> CreateStubFrameRemote() { … }
mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
CreateStubBrowserInterfaceBrokerReceiver() { … }
blink::mojom::PolicyContainerBindParamsPtr
CreateStubPolicyContainerBindParams() { … }
mojo::PendingAssociatedReceiver<blink::mojom::AssociatedInterfaceProvider>
CreateStubAssociatedInterfaceProviderReceiver() { … }
static constexpr const char kDeprecationTrialName[] = …;
}
class MockOriginTrialsDelegate
: public content::OriginTrialsControllerDelegate { … };
class AcceptLanguageUtilsTests : public RenderViewHostImplTestHarness { … };
TEST_F(AcceptLanguageUtilsTests, AcceptLanguageMatchContentLanguage) { … }
TEST_F(AcceptLanguageUtilsTests, OriginCanReduceAcceptLanguage) { … }
TEST_F(AcceptLanguageUtilsTests, FirstMatchPreferredLang) { … }
TEST_F(AcceptLanguageUtilsTests, AddNavigationRequestAcceptLanguageHeaders) { … }
TEST_F(AcceptLanguageUtilsTests, ParseAndPersistAcceptLanguageForNavigation) { … }
TEST_F(AcceptLanguageUtilsTests, VerifyClearAcceptLanguage) { … }
TEST_F(AcceptLanguageUtilsTests, ValidateDeprecationOriginTrial) { … }
TEST_F(AcceptLanguageUtilsTests, ThrottleProcessResponse) { … }
class CreateAcceptLanguageUtilsTest : public ::testing::Test { … };
TEST_F(CreateAcceptLanguageUtilsTest, CreateUtils) { … }
}