#include <array>
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "base/base64.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/run_until.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "base/time/time_override.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/devtools/protocol/devtools_protocol_test_support.h"
#include "chrome/browser/devtools/url_constants.h"
#include "chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h"
#include "chrome/browser/extensions/error_console/error_console.h"
#include "chrome/browser/extensions/error_console/error_console_test_observer.h"
#include "chrome/browser/extensions/extension_action_runner.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/extension_with_management_policy_apitest.h"
#include "chrome/browser/extensions/permissions/active_tab_permission_granter.h"
#include "chrome/browser/extensions/permissions/scripting_permissions_modifier.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/new_tab_page/one_google_bar/one_google_bar_loader.h"
#include "chrome/browser/new_tab_page/one_google_bar/one_google_bar_service.h"
#include "chrome/browser/new_tab_page/one_google_bar/one_google_bar_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_destroyer.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/login/login_handler.h"
#include "chrome/browser/ui/search/ntp_test_utils.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/search_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/embedder_support/switches.h"
#include "components/google/core/common/google_switches.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/policy_constants.h"
#include "components/prefs/pref_service.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/proxy_config/proxy_config_pref_names.h"
#include "components/ukm/test_ukm_recorder.h"
#include "components/web_package/web_bundle_builder.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/webui_config_map.h"
#include "content/public/common/content_features.h"
#include "content/public/common/page_type.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/simple_url_loader_test_helper.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/url_loader_interceptor.h"
#include "content/public/test/url_loader_monitor.h"
#include "content/public/test/web_transport_simple_test_server.h"
#include "extensions/browser/api/web_request/extension_web_request_event_router.h"
#include "extensions/browser/api/web_request/web_request_api.h"
#include "extensions/browser/background_script_executor.h"
#include "extensions/browser/blocked_action_type.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/service_worker/service_worker_task_queue.h"
#include "extensions/browser/service_worker/service_worker_test_utils.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/features/feature.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "extensions/test/test_extension_dir.h"
#include "google_apis/gaia/gaia_switches.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/network_isolation_key.h"
#include "net/cookies/site_for_cookies.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_util.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "net/test/test_data_directory.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/cpp/url_loader_factory_builder.h"
#include "services/network/public/mojom/fetch_api.mojom.h"
#include "services/network/test/test_url_loader_client.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "ui/base/ui_base_features.h"
#include "ui/webui/untrusted_web_ui_browsertest_util.h"
#include "url/origin.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/profiles/profile_helper.h"
#endif
WebContents;
namespace extensions {
namespace {
constexpr char kOriginTrialPublicKeyForTesting[] = …;
class NavigateTabMessageHandler { … };
const char kPerformXhrJs[] = …;
const char kHeaderValueFromExtension[] = …;
const char kHeaderValueFromServer[] = …;
constexpr char kCORSUrl[] = …;
constexpr char kCORSProxyUser[] = …;
constexpr char kCORSProxyPass[] = …;
constexpr char kCustomPreflightHeader[] = …;
void PerformXhrInFrame(content::RenderFrameHost* frame,
const std::string& host,
int port,
const std::string& page) { … }
base::Value ExecuteScriptAndReturnValue(const ExtensionId& extension_id,
content::BrowserContext* context,
const std::string& script) { … }
std::optional<bool> ExecuteScriptAndReturnBool(const ExtensionId& extension_id,
content::BrowserContext* context,
const std::string& script) { … }
std::optional<std::string> ExecuteScriptAndReturnString(
const ExtensionId& extension_id,
content::BrowserContext* context,
const std::string& script) { … }
int GetCountFromBackgroundScript(const Extension* extension,
content::BrowserContext* context,
const std::string& variable_name) { … }
int GetWebRequestCountFromBackgroundScript(const Extension* extension,
content::BrowserContext* context) { … }
bool HasSeenWebRequestInBackgroundScript(const Extension* extension,
content::BrowserContext* context,
const std::string& hostname) { … }
void WaitForExtraHeadersListener(base::WaitableEvent* event,
content::BrowserContext* browser_context) { … }
}
class ExtensionWebRequestApiTest : public ExtensionApiTest { … };
ContextType;
enum class BackgroundResourceFetchTestCase { … };
class ExtensionWebRequestApiTestWithContextType
: public ExtensionWebRequestApiTest,
public testing::WithParamInterface<
std::pair<ContextType, BackgroundResourceFetchTestCase>> { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class DevToolsFrontendInWebRequestApiTest : public ExtensionApiTest { … };
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestApi) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestSimple) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DISABLED_WebRequestComplex) { … }
class ExtensionDevToolsProtocolTest
: public ExtensionWebRequestApiTestWithContextType,
public content::TestDevToolsProtocolClient { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ExtensionDevToolsProtocolTest,
HeaderOverriddenByExtension) { … }
IN_PROC_BROWSER_TEST_P(ExtensionDevToolsProtocolTest,
HeaderOverrideViaProtocolAllowedByExtension) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, DISABLED_WebRequestTypes) { … }
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#define MAYBE_WebRequestTestOSDD …
#else
#define MAYBE_WebRequestTestOSDD …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
MAYBE_WebRequestTestOSDD) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
WebRequestUnloadAfterRequest) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
DISABLED_WebRequestUnloadImmediately) { … }
enum class ProfileMode { … };
struct ARTestParams { … };
class ExtensionWebRequestApiAuthRequiredTest
: public ExtensionWebRequestApiTest,
public testing::WithParamInterface<ARTestParams> { … };
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiAuthRequiredTest,
WebRequestAuthRequired) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiAuthRequiredTest,
WebRequestAuthRequiredAsync) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiAuthRequiredTest,
DISABLED_WebRequestAuthRequiredParallel) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestBlocking) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DISABLED_WebRequestBlockingSlow) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestBlockingSetCookieHeader) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestExtraHeaders) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DISABLED_WebRequestExtraHeaders_Auth) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestChangeCSPHeaders) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_WebRequestCORSWithExtraHeaders …
#else
#define MAYBE_WebRequestCORSWithExtraHeaders …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
MAYBE_WebRequestCORSWithExtraHeaders) { … }
#if defined(ADDRESS_SANITIZER)
#define MAYBE_WebRequestRedirects …
#else
#define MAYBE_WebRequestRedirects …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
MAYBE_WebRequestRedirects) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestRedirectsWithExtraHeaders) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestRedirectsToInsecure) { … }
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#define MAYBE_WebRequestRedirectsWorkers …
#else
#define MAYBE_WebRequestRedirectsWorkers …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
MAYBE_WebRequestRedirectsWorkers) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DISABLED_WebRequestSubresourceRedirects) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DISABLED_WebRequestSubresourceRedirectsWithExtraHeaders) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestNewTab) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestDeclarative1) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DISABLED_WebRequestDeclarative1Broken) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestDeclarative2) { … }
void ExtensionWebRequestApiTest::RunPermissionTest(
const char* extension_directory,
bool load_extension_with_incognito_permission,
bool wait_for_extension_loaded_in_incognito,
const char* expected_content_regular_window,
const char* exptected_content_incognito_window,
ContextType context_type) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestDeclarativePermissionSpanning1) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestDeclarativePermissionSpanning2) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestDeclarativePermissionSplit1) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestDeclarativePermissionSplit2) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, DISABLED_PostData1) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, DISABLED_PostData2) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DeclarativeSendMessage) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_LINUX)
#define MAYBE_IncognitoSplitModeReload …
#else
#define MAYBE_IncognitoSplitModeReload …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
MAYBE_IncognitoSplitModeReload) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
ExtensionRequests) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, HostedAppRequest) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestWithWithheldPermissions) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestWithheldPermissionsCrossOriginRequests) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WithheldHostPermissionsForCrossOriginWithoutInitiator) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestClientsGoogleComProtection) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestPacRequestProtection) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestDiceHeaderProtection) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, DISABLED_WebSocketRequest) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
DISABLED_WebSocketRequestAuthRequired) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebSocketRequestOnWorker) { … }
#if BUILDFLAG(IS_CHROMEOS)
#define MAYBE_WebSocketCleanClose …
#else
#define MAYBE_WebSocketCleanClose …
#endif
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, MAYBE_WebSocketCleanClose) { … }
class ExtensionWebRequestApiWebTransportTest
: public ExtensionWebRequestApiTest { … };
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiWebTransportTest, DISABLED_Main) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiWebTransportTest,
DedicaterWorker) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiWebTransportTest, SharedWorker) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiWebTransportTest, ServiceWorker) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
WebRequestURLLoaderInterception) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
InitiatorAccessRequired) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
WebRequestApiClearsBindingOnFirstListener) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
WebRequestApiDoesNotCrashOnErrorAfterProfileDestroyed) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
OpenNewTabFromChromeUntrusted) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
NavigateMainFrameToWebOriginFromChromeUntrusted) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
NavigateMainFrameToWebUIOriginFromChromeUntrusted) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
SubframeNavigationsInChromeUntrustedPage) { … }
class NTPInterceptionWebRequestAPITest
: public ExtensionApiTest,
public testing::WithParamInterface<ContextType> { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(NTPInterceptionWebRequestAPITest,
NTPRendererRequestsHidden) { … }
class WebUiNtpInterceptionWebRequestAPITest
: public ExtensionApiTest,
public OneGoogleBarServiceObserver,
public testing::WithParamInterface<ContextType> { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(WebUiNtpInterceptionWebRequestAPITest,
OneGoogleBarRequestsHidden) { … }
IN_PROC_BROWSER_TEST_F(DevToolsFrontendInWebRequestApiTest, HiddenRequests) { … }
class WebRequestApiTestWithManagementPolicy
: public ExtensionApiTestWithManagementPolicy,
public testing::WithParamInterface<ContextType> { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(WebRequestApiTestWithManagementPolicy,
InitiatorProtectedByPolicy) { … }
IN_PROC_BROWSER_TEST_P(WebRequestApiTestWithManagementPolicy,
UrlProtectedByPolicy) { … }
IN_PROC_BROWSER_TEST_P(WebRequestApiTestWithManagementPolicy,
WebRequestProtectedByPolicy) { … }
class ExtensionWebRequestMockedClockTest
: public ExtensionWebRequestApiTestWithContextType { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestMockedClockTest,
OnActionIgnored_Redirect) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
StaleHeadersAfterRedirect) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
ChangeHeaderUMAs) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
RemoveHeaderUMAs) { … }
struct SWTestParams { … };
class ServiceWorkerWebRequestApiTest
: public testing::WithParamInterface<SWTestParams>,
public ExtensionApiTest { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest, ServiceWorkerFetch) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest, ServiceWorkerFallback) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest,
ServiceWorkerNoFetchHandler) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest,
ServiceWorkerFallbackAfterRedirect) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest, ServiceWorkerScript) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest,
ModuleServiceWorkerScript) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest,
ModuleServiceWorkerScriptWithStaticImport) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerWebRequestApiTest,
ServiceWorkerNavigationPreload) { … }
#if BUILDFLAG(IS_LINUX) && defined(ADDRESS_SANITIZER) && defined(LEAK_SANITIZER)
#define MAYBE_Initiator_SpanningIncognito …
#else
#define MAYBE_Initiator_SpanningIncognito …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
MAYBE_Initiator_SpanningIncognito) { … }
#if BUILDFLAG(IS_LINUX)
#define MAYBE_Initiator_SplitIncognito …
#else
#define MAYBE_Initiator_SplitIncognito …
#endif
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
MAYBE_Initiator_SplitIncognito) { … }
std::unique_ptr<net::test_server::HttpResponse> HandleXHRRequest(
const net::test_server::HttpRequest& request) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
ExtraHeadersWithHSTSUpgrade) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
ErrorPageForBlockedMainFrameNavigation) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
HSTSUpgradeAfterRedirect) { … }
IN_PROC_BROWSER_TEST_P(ExtensionWebRequestApiTestWithContextType,
DISABLED_HSTSUpgradeAfterRedirectWithCSP) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
ListenersInMultipleContexts) { … }
struct SWBTestParams { … };
class SubresourceWebBundlesWebRequestApiTest
: public testing::WithParamInterface<SWBTestParams>,
public ExtensionApiTest { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(SubresourceWebBundlesWebRequestApiTest,
DISABLED_RequestIntercepted) { … }
IN_PROC_BROWSER_TEST_P(SubresourceWebBundlesWebRequestApiTest,
RequestCanceled) { … }
IN_PROC_BROWSER_TEST_P(SubresourceWebBundlesWebRequestApiTest, ChangeHeader) { … }
IN_PROC_BROWSER_TEST_P(SubresourceWebBundlesWebRequestApiTest,
ChangeHeaderUuidInPackageUrlResource) { … }
IN_PROC_BROWSER_TEST_P(SubresourceWebBundlesWebRequestApiTest,
RequestRedirected) { … }
IN_PROC_BROWSER_TEST_P(SubresourceWebBundlesWebRequestApiTest,
WebBundleRequestRedirected) { … }
IN_PROC_BROWSER_TEST_P(SubresourceWebBundlesWebRequestApiTest,
WebBundleRequestCanceledWithResourceType) { … }
enum class RedirectType { … };
struct RITestParams { … };
class RedirectInfoWebRequestApiTest
: public testing::WithParamInterface<RITestParams>,
public ExtensionApiTest { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(RedirectInfoWebRequestApiTest,
VerifyRedirectInfoMainFrame) { … }
IN_PROC_BROWSER_TEST_P(RedirectInfoWebRequestApiTest,
VerifyBeforeRequestRedirectInfoSubFrame) { … }
IN_PROC_BROWSER_TEST_P(RedirectInfoWebRequestApiTest,
VerifyInvalidUrlRedirection) { … }
class ProxyCORSWebRequestApiTest
: public ExtensionApiTest,
public testing::WithParamInterface<ContextType> { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ProxyCORSWebRequestApiTest,
PreflightCompletesSuccessfully) { … }
class ExtensionWebRequestApiFencedFrameTest
: public ExtensionWebRequestApiTest { … };
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiFencedFrameTest, Load) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiFencedFrameTest,
DeclarativeSendMessage) { … }
class ExtensionWebRequestApiPrerenderingTest
: public ExtensionWebRequestApiTest { … };
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiPrerenderingTest, Load) { … }
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiPrerenderingTest, LoadIntoNewTab) { … }
class WebRequestPersistentListenersTest
: public ExtensionWebRequestApiTestWithContextType { … };
namespace {
constexpr char kGetNumRequests[] = …;
}
IN_PROC_BROWSER_TEST_P(WebRequestPersistentListenersTest,
PRE_TestListenersArePersistent) { … }
IN_PROC_BROWSER_TEST_P(WebRequestPersistentListenersTest,
TestListenersArePersistent) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class ManifestV3WebRequestApiTest : public ExtensionWebRequestApiTest { … };
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest, WebRequestBlocking) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
MultipleListenersAndContexts) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
WebRequestBlocking_AfterWorkerShutdown) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
WebRequestObservation_AfterWorkerShutdown) { … }
IN_PROC_BROWSER_TEST_F(
ManifestV3WebRequestApiTest,
ServiceWorkerWithWebRequest_UnloadExtensionWhileWorkerInactive) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
ServiceWorkerWithWebRequest_ManuallyRemoveListener) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
ListenersInMultipleContextsWithLazyDispatch) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest, TestOnAuthRequiredTab) { … }
class OnAuthRequiredApiTest : public ExtensionApiTest { … };
IN_PROC_BROWSER_TEST_F(OnAuthRequiredApiTest,
TestOnAuthRequiredExtensionServiceWorker) { … }
IN_PROC_BROWSER_TEST_F(OnAuthRequiredApiTest,
TestOnAuthRequiredWebsiteServiceWorker) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest, AsyncListenerRegistration) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
ServiceWorkerGoesAwayWhileHandlingRequest) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
TestOnAuthRequired_NoPermission) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest,
TestWebviewIdSpecifiedOnEvent_NoPermission) { … }
IN_PROC_BROWSER_TEST_F(ManifestV3WebRequestApiTest, RecordUkmOnNavigation) { … }
}