#include <stddef.h>
#include <stdint.h>
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/statistics_recorder.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.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/task/task_traits.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/with_feature_override.h"
#include "base/time/time.h"
#include "base/uuid.h"
#include "build/build_config.h"
#include "components/services/storage/public/mojom/cache_storage_control.mojom.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/process_lock.h"
#include "content/browser/renderer_host/code_cache_host_impl.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/service_worker/service_worker_client.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_core_observer.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_controllee_request_handler.h"
#include "content/browser/service_worker/service_worker_fetch_dispatcher.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/browser/service_worker/service_worker_version.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/web_package/signed_exchange_consts.h"
#include "content/common/content_constants_internal.h"
#include "content/common/features.h"
#include "content/common/service_worker/race_network_request_write_buffer_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/console_message.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/cors_origin_pattern_setter.h"
#include "content/public/browser/navigation_entry.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/service_worker_context_observer.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/isolated_world_ids.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_content_browser_client.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "content/public/test/mock_client_hints_controller_delegate.h"
#include "content/public/test/navigation_handle_observer.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/url_loader_interceptor.h"
#include "content/shell/browser/shell.h"
#include "content/shell/browser/shell_browser_context.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "media/media_buildflags.h"
#include "net/base/test_completion_callback.h"
#include "net/cert/cert_status_flags.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_status_code.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 "services/metrics/public/cpp/ukm_builders.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/fetch_api.mojom.h"
#include "services/network/public/mojom/service_worker_router_info.mojom-shared.h"
#include "storage/browser/blob/blob_handle.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/loader/code_cache.mojom-test-utils.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration_options.mojom.h"
#include "third_party/re2/src/re2/re2.h"
CacheStorageError;
namespace content {
namespace {
MainResourceLoadCompletedUkmEntry;
const int kV8CacheTimeStampDataSize = …;
void ExpectRegisterResultAndRun(blink::ServiceWorkerStatusCode expected,
base::RepeatingClosure continuation,
blink::ServiceWorkerStatusCode actual) { … }
void ExpectUnregisterResultAndRun(
blink::ServiceWorkerStatusCode expected_status,
base::RepeatingClosure continuation,
blink::ServiceWorkerStatusCode actual_status) { … }
class WorkerStateObserver : public ServiceWorkerContextCoreObserver { … };
class WorkerClientDestroyedObserver : public ServiceWorkerContextCoreObserver { … };
std::unique_ptr<net::test_server::HttpResponse> VerifySaveDataHeaderInRequest(
const net::test_server::HttpRequest& request) { … }
std::unique_ptr<net::test_server::HttpResponse>
VerifySaveDataNotInAccessControlRequestHeader(
const net::test_server::HttpRequest& request) { … }
void CountScriptResources(ServiceWorkerContextWrapper* wrapper,
const GURL& scope,
int* num_resources) { … }
void StoreString(std::string* result,
base::OnceClosure callback,
base::Value value) { … }
int GetInt(const base::Value::Dict& dict, std::string_view key) { … }
std::string GetString(const base::Value::Dict& dict, std::string_view key) { … }
bool GetBoolean(const base::Value::Dict& dict, std::string_view key) { … }
bool CheckHeader(const base::Value::Dict& dict,
std::string_view header_name,
std::string_view header_value) { … }
bool HasHeader(const base::Value::Dict& dict, std::string_view header_name) { … }
const char kNavigationPreloadNetworkError[] = …;
void CheckPageIsMarkedSecure(
Shell* shell,
scoped_refptr<net::X509Certificate> expected_certificate) { … }
}
class ServiceWorkerBrowserTest : public ContentBrowserTest { … };
class MockContentBrowserClient : public ContentBrowserTestContentBrowserClient { … };
class WorkerRunningStatusObserver : public ServiceWorkerContextObserver { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, RequestOrigin) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, FetchPageWithSaveData) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, CrossOriginFetchWithSaveData) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
FetchPageWithSaveDataPassThroughOnFetch) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, Reload) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, IdleTimerWithDevTools) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
ResponseFromHTTPSServiceWorkerIsMarkedAsSecure) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
ResponseFromHTTPServiceWorkerIsNotMarkedAsSecure) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, ImportsBustMemcache) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, GetRunningServiceWorkerInfos) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, StartWorkerWhileInstalling) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
#define MAYBE_DispatchFetchEventToStoppedWorkerSynchronously …
#else
#define MAYBE_DispatchFetchEventToStoppedWorkerSynchronously …
#endif
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
MAYBE_DispatchFetchEventToStoppedWorkerSynchronously) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
DispatchFetchEventToBrokenWorker) { … }
class UserAgentServiceWorkerBrowserTest : public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(UserAgentServiceWorkerBrowserTest, NavigatorUserAgent) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
DISABLED_UpdateOnScriptUrlChange) { … }
class ServiceWorkerNavigationPreloadTest : public ServiceWorkerBrowserTest { … };
const std::string
ServiceWorkerNavigationPreloadTest::kNavigationPreloadHeaderName(
"Service-Worker-Navigation-Preload");
const std::string
ServiceWorkerNavigationPreloadTest::kEnableNavigationPreloadScript(
"self.addEventListener('activate', event => {\n"
" event.waitUntil(self.registration.navigationPreload.enable());\n"
" });\n");
const std::string
ServiceWorkerNavigationPreloadTest::kPreloadResponseTestScript = …;
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest, NetworkFallback) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest, SetHeaderValue) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
RespondWithNavigationPreload) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest, GetResponseText) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
GetLargeResponseText) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
GetLargeResponseCloneText) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
GetLargeResponseReadableStream) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest, NetworkError) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
PreloadHeadersSimple) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest, NotEnabled) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
PreloadHeadersCustom) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
InvalidRedirect_MultiLocation) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
InvalidRedirect_InvalidLocation) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerNavigationPreloadTest,
RedirectAndRespondWithNavigationPreload) { … }
static int CountRenderProcessHosts() { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, Registration) { … }
enum class ServiceWorkerScriptImportType { … };
struct ServiceWorkerScriptChecksumInfo { … };
class ServiceWorkerSha256ScriptChecksumBrowserTest
: public ServiceWorkerBrowserTest,
public testing::WithParamInterface<
std::tuple<ServiceWorkerScriptImportType, bool, bool>> { … };
IN_PROC_BROWSER_TEST_P(ServiceWorkerSha256ScriptChecksumBrowserTest,
Sha256ScriptChecksum) { … }
INSTANTIATE_TEST_SUITE_P(…);
class CacheStorageSideDataSizeChecker
: public base::RefCounted<CacheStorageSideDataSizeChecker> { … };
class ServiceWorkerV8CodeCacheForCacheStorageTest
: public ServiceWorkerBrowserTest { … };
const char ServiceWorkerV8CodeCacheForCacheStorageTest::kPageUrl[] = …;
const char ServiceWorkerV8CodeCacheForCacheStorageTest::kWorkerUrl[] = …;
const char ServiceWorkerV8CodeCacheForCacheStorageTest::kScriptUrl[] = …;
IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CodeCacheForCacheStorageTest,
V8CacheOnCacheStorage) { … }
class ServiceWorkerV8CodeCacheForCacheStorageNoneTest
: public ServiceWorkerV8CodeCacheForCacheStorageTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerV8CodeCacheForCacheStorageNoneTest,
V8CacheOnCacheStorage) { … }
namespace {
class CacheStorageControlForBadOrigin
: public storage::mojom::CacheStorageControl { … };
}
class ServiceWorkerCacheStorageFullCodeCacheFromInstallEventTest
: public ServiceWorkerV8CodeCacheForCacheStorageTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerCacheStorageFullCodeCacheFromInstallEventTest,
FullCodeCacheGenerated) { … }
class ServiceWorkerCacheStorageFullCodeCacheFromInstallEventDisabledByHintTest
: public ServiceWorkerV8CodeCacheForCacheStorageTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerCacheStorageFullCodeCacheFromInstallEventDisabledByHintTest,
FullCodeCacheNotGenerated) { … }
class ServiceWorkerCacheStorageFullCodeCacheFromInstallEventOpaqueResponseTest
: public ServiceWorkerV8CodeCacheForCacheStorageTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerCacheStorageFullCodeCacheFromInstallEventOpaqueResponseTest,
FullCodeCacheGenerated) { … }
class ServiceWorkerDisableWebSecurityTest : public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest,
GetRegistrationNoCrash) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_RegisterNoCrash …
#else
#define MAYBE_RegisterNoCrash …
#endif
IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest,
MAYBE_RegisterNoCrash) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest, UnregisterNoCrash) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest, UpdateNoCrash) { … }
class HeaderInjectingThrottle : public blink::URLLoaderThrottle { … };
class ThrottlingContentBrowserClient
: public ContentBrowserTestContentBrowserClient { … };
class ServiceWorkerURLLoaderThrottleTest : public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerURLLoaderThrottleTest,
FetchEventForNavigationHasThrottledRequest) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerURLLoaderThrottleTest,
RedirectOccursBeforeFetchEvent) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerURLLoaderThrottleTest,
NavigationHasThrottledRequestHeadersAfterNetworkFallback) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerURLLoaderThrottleTest,
NavigationPreloadHasThrottledRequestHeaders) { … }
class ServiceWorkerThrottlingTest : public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerThrottlingTest, ThrottleInstalling) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerThrottlingTest,
ThrottleInstallingWithCacheAddAll) { … }
class ServiceWorkerCrossOriginIsolatedBrowserTest
: public ServiceWorkerBrowserTest,
public testing::WithParamInterface<std::tuple<bool, bool>> { … };
IN_PROC_BROWSER_TEST_P(ServiceWorkerCrossOriginIsolatedBrowserTest,
FreshInstall) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_PostInstallRun …
#else
#define MAYBE_PostInstallRun …
#endif
IN_PROC_BROWSER_TEST_P(ServiceWorkerCrossOriginIsolatedBrowserTest,
MAYBE_PostInstallRun) { … }
class ServiceWorkerCoopBrowserTest : public ServiceWorkerBrowserTest,
public testing::WithParamInterface<bool> { … };
IN_PROC_BROWSER_TEST_P(ServiceWorkerCoopBrowserTest, FreshInstall) { … }
IN_PROC_BROWSER_TEST_P(ServiceWorkerCoopBrowserTest, MAYBE_PostInstallRun) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class ServiceWorkerBackForwardCacheAndKeepActiveFreezingBrowserTest
: public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerBackForwardCacheAndKeepActiveFreezingBrowserTest,
ShareProcessWithBackForwardCachedPageAndLivePage) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerBackForwardCacheAndKeepActiveFreezingBrowserTest,
ShareProcessWithBackForwardCachedPageOnly) { … }
class ServiceWorkerBackForwardCacheBrowserTest
: public ServiceWorkerBrowserTest { … };
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_EvictionOfBackForwardCacheWithMultipleServiceWorkers …
#else
#define MAYBE_EvictionOfBackForwardCacheWithMultipleServiceWorkers …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerBackForwardCacheBrowserTest,
MAYBE_EvictionOfBackForwardCacheWithMultipleServiceWorkers) { … }
class ServiceWorkerFencedFrameBrowserTest : public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerFencedFrameBrowserTest,
AncestorFrameTypeIsStoredInServiceWorker) { … }
class ServiceWorkerFencedFrameProcessAllocationBrowserTest
: public ServiceWorkerFencedFrameBrowserTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ServiceWorkerFencedFrameProcessAllocationBrowserTest,
ServiceWorkerIsInFencedFrameProcess) { … }
class ServiceWorkerBrowserTestWithStoragePartitioning
: public base::test::WithFeatureOverride,
public ServiceWorkerBrowserTest { … };
INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE(…);
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
#define MAYBE_StorageKeyWithHostPermissionsWithDedicatedWorkers …
#else
#define MAYBE_StorageKeyWithHostPermissionsWithDedicatedWorkers …
#endif
IN_PROC_BROWSER_TEST_P(
ServiceWorkerBrowserTestWithStoragePartitioning,
MAYBE_StorageKeyWithHostPermissionsWithDedicatedWorkers) { … }
#if !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_MAC)
#define MAYBE_StorageKeyWithHostPermissionsWithSharedWorkers …
#else
#define MAYBE_StorageKeyWithHostPermissionsWithSharedWorkers …
#endif
IN_PROC_BROWSER_TEST_P(ServiceWorkerBrowserTestWithStoragePartitioning,
MAYBE_StorageKeyWithHostPermissionsWithSharedWorkers) { … }
#endif
enum class SpeculativeStartupNavigationType { … };
class ServiceWorkerSpeculativeStartupBrowserTest
: public ServiceWorkerBrowserTest,
public testing::WithParamInterface<SpeculativeStartupNavigationType> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ServiceWorkerSpeculativeStartupBrowserTest,
NavigationWillBeCanceledByBeforeUnload) { … }
class ServiceWorkerSpeculativeStartupWithoutParamBrowserTest
: public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerSpeculativeStartupWithoutParamBrowserTest,
NavigatingToAboutSrcdocDoesNotCrash) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, WarmUpAndStartServiceWorker) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, WarmUpWorkerAndTimeout) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, WarmUpWorkerTwice) { … }
class ServiceWorkerWarmUpBrowserTestBase : public ServiceWorkerBrowserTest { … };
class ServiceWorkerWarmUpOnIdleTimeoutBrowserTest
: public ServiceWorkerWarmUpBrowserTestBase { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerWarmUpOnIdleTimeoutBrowserTest,
DoNotWarmUpOnStopWithoutIdleTimeout) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerWarmUpOnIdleTimeoutBrowserTest,
WarmUpOnIdleTimeout) { … }
#if !BUILDFLAG(IS_ANDROID)
struct ServiceWorkerWarmUpByPointerBrowserTestParam { … };
class ServiceWorkerWarmUpByPointerBrowserTest
: public ServiceWorkerWarmUpBrowserTestBase,
public testing::WithParamInterface<
ServiceWorkerWarmUpByPointerBrowserTestParam> { … };
const ServiceWorkerWarmUpByPointerBrowserTestParam
kServiceWorkerWarmUpByPointerBrowserTestParams[] = …;
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ServiceWorkerWarmUpByPointerBrowserTest,
PointeroverOrPointerdownWillWarmUpServiceWorker) { … }
#endif
class ServiceWorkerSkipEmptyFetchHandlerBrowserTest
: public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerSkipEmptyFetchHandlerBrowserTest,
HasNotSkippedMetrics) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#define MAYBE_HasSkippedForEmptyFetchHandlerMetrics …
#else
#define MAYBE_HasSkippedForEmptyFetchHandlerMetrics …
#endif
IN_PROC_BROWSER_TEST_F(ServiceWorkerSkipEmptyFetchHandlerBrowserTest,
MAYBE_HasSkippedForEmptyFetchHandlerMetrics) { … }
class ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest
: public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_NetworkRequest_Wins_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_MarkedAsSecure) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_MimeTypeSniffed) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_Fetch_No_Respond) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_NotFound_FetchHandler_Respond) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_NotFound_FetchHandler_NotRespond) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_NetworkRequest_Wins_FetchHandler_Fallback …
#else
#define MAYBE_NetworkRequest_Wins_FetchHandler_Fallback …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_NetworkRequest_Wins_FetchHandler_Fallback) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_FetchHandler_Fallback_LargeData) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
NetworkRequest_Wins_Post) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_NetworkRequest_Wins_Redirect …
#else
#define MAYBE_NetworkRequest_Wins_Redirect …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_NetworkRequest_Wins_Redirect) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_NetworkRequest_Wins_Redirect_PassThrough …
#else
#define MAYBE_NetworkRequest_Wins_Redirect_PassThrough …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_NetworkRequest_Wins_Redirect_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
FetchHandler_Wins) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
FetchHandler_Wins_Fallback) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
FetchHandler_Wins_NotFound) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_FetchHandler_Wins_Redirect …
#else
#define MAYBE_FetchHandler_Wins_Redirect …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_FetchHandler_Wins_Redirect) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_FetchHandler_Wins_Redirect_PassThrough …
#else
#define MAYBE_FetchHandler_Wins_Redirect_PassThrough …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_FetchHandler_Wins_Redirect_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
FetchHandler_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
FetchHandler_PassThrough_Clone) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_Subresource_NetworkRequest_Wins …
#else
#define MAYBE_Subresource_NetworkRequest_Wins …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_Subresource_NetworkRequest_Wins) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_NetworkRequest_Wins_Fetch_No_Respond) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_NetworkRequest_Wins_NotFound) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_NetworkRequest_Wins_FetchHandler_Fallback) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_NetworkRequest_Wins_FetchHandler_Fallback_LargeData) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_NetworkRequest_Wins_FetchHandler_Fallback_Redirect) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_NetworkRequest_Wins_Post) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_Redirect_Multiple) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_Subresource_NetworkRequest_Wins_Redirect …
#else
#define MAYBE_Subresource_NetworkRequest_Wins_Redirect …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_Subresource_NetworkRequest_Wins_Redirect) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_Subresource_NetworkRequest_Wins_Redirect_PassThrough …
#else
#define MAYBE_Subresource_NetworkRequest_Wins_Redirect_PassThrough …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_Subresource_NetworkRequest_Wins_Redirect_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_FetchHandler_Wins) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_FetchHandler_Wins_Fallback) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_FetchHandler_Wins_Fallback_Redirect) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_FetchHandler_Wins_NotFound) { … }
#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID)
#define MAYBE_Subresource_FetchHandler_Wins_Redirect …
#else
#define MAYBE_Subresource_FetchHandler_Wins_Redirect …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_Subresource_FetchHandler_Wins_Redirect) { … }
#if BUILDFLAG(IS_FUCHSIA)
#define MAYBE_Subresource_FetchHandler_Wins_Redirect_PassThrough …
#else
#define MAYBE_Subresource_FetchHandler_Wins_Redirect_PassThrough …
#endif
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
MAYBE_Subresource_FetchHandler_Wins_Redirect_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest,
Subresource_FetchHandler_PassThrough) { … }
class ServiceWorkerAutoPreloadBrowserTest
: public ServiceWorkerStaticRouterRaceNetworkAndFetchHandlerSourceBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
NetworkRequestRepliedFirstButFetchHandlerResultIsUsed) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest, PassThrough) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
PassThrough_LargeData) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
NetworkRequest_Wins_FetchHandler_Fallback) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
FetchHandler_Wins_Fallback) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerAutoPreloadBrowserTest,
Subresource_NetworkRequestRepliedFirstButFetchHandlerResultIsUsed) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
Subresource_PassThrough) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
Subresource_PassThrough_LargeData) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
Subresource_NetworkRequest_Wins_FetchHandler_Fallback) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadBrowserTest,
Subresource_FetchHandler_Wins_Fallback) { … }
class ServiceWorkerAutoPreloadWithBlockedHostsBrowserTest
: public ServiceWorkerAutoPreloadBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadWithBlockedHostsBrowserTest,
BlockedHosts) { … }
class ServiceWorkerAutoPreloadWithEnableSubresourcePreloadBrowserTest
: public ServiceWorkerAutoPreloadBrowserTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerAutoPreloadWithEnableSubresourcePreloadBrowserTest,
Disabled) { … }
class ServiceWorkerAutoPreloadWithEnableOnlyWhenSWNotRunningBrowserTest
: public ServiceWorkerAutoPreloadBrowserTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerAutoPreloadWithEnableOnlyWhenSWNotRunningBrowserTest,
NotRunning) { … }
IN_PROC_BROWSER_TEST_F(
ServiceWorkerAutoPreloadWithEnableOnlyWhenSWNotRunningBrowserTest,
Running) { … }
class ServiceWorkerAutoPreloadAllowListBrowserTest
: public ServiceWorkerAutoPreloadBrowserTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ServiceWorkerAutoPreloadAllowListBrowserTest,
EnableAutoPreloadIfScriptIsAllowed) { … }
class ServiceWorkerAutoPreloadOptOutBrowserTest
: public ServiceWorkerAutoPreloadBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadOptOutBrowserTest,
MainResourceFetchHandlerShouldNotRace) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerAutoPreloadOptOutBrowserTest,
SubresourceFetchHandlerShouldNotRace) { … }
class CacheStorageDataChecker
: public base::RefCounted<CacheStorageDataChecker> { … };
class ServiceWorkerStaticRouterBrowserTest : public ServiceWorkerBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceFromFetchEventRule) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceNoRuleMatchedResponseFromFetchHandler) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceFromNetworkRule) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceNoRuleMatchedResponseFromFetchHandler) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceFromNetworkRule) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceRaceNetworkAndFetch) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceRaceNetworkAndFetch) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceRunningStatus) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceRunningStatus) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceCacheStorageHit) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceCacheStorageMissThenNetworkFallback) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceCacheStorageHitWithName) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
MainResourceCacheStorageMissDueToNameMismatch) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceCacheStorageHit) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceCacheStorageMiss) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceCacheStorageHitWithName) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
SubresourceCacheStorageMissDueToNameMissmatch) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest,
FetchEventShouldBeUsedWithFetchHandler) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest, MainResourceNot) { … }
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterBrowserTest, SubresourceNot) { … }
class ServiceWorkerStaticRouterDisablingServiceWorkerStartBrowserTest
: public ServiceWorkerStaticRouterBrowserTest { … };
IN_PROC_BROWSER_TEST_F(
ServiceWorkerStaticRouterDisablingServiceWorkerStartBrowserTest,
MainResourceNetworkFallback) { … }
class ServiceWorkerStaticRouterOriginTrialBrowserTest
: public ServiceWorkerStaticRouterBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ServiceWorkerStaticRouterOriginTrialBrowserTest,
Fallback) { … }
}