#include "content/browser/service_worker/service_worker_process_manager.h"
#include <memory>
#include <string>
#include "base/memory/raw_ptr.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/site_info.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/storage_partition_impl.h"
#include "content/common/url_schemes.h"
#include "content/public/browser/child_process_host.h"
#include "content/public/common/content_features.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_utils.h"
#include "content/test/test_content_client.h"
#include "services/network/public/mojom/cross_origin_embedder_policy.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace content {
AncestorFrameType;
namespace {
class SiteInstanceRenderProcessHostFactory : public RenderProcessHostFactory { … };
}
class ServiceWorkerProcessManagerTest : public testing::Test { … };
TEST_F(ServiceWorkerProcessManagerTest,
AllocateWorkerProcess_WithProcessReuse) { … }
TEST_F(ServiceWorkerProcessManagerTest,
AllocateWorkerProcess_WithoutProcessReuse) { … }
TEST_F(ServiceWorkerProcessManagerTest, AllocateWorkerProcess_InShutdown) { … }
TEST_F(ServiceWorkerProcessManagerTest,
AllocateWorkerProcess_StoragePartitionForGuests) { … }
class CustomSchemeContentClient : public TestContentClient { … };
class ScopedCustomSchemeContentBrowserClient : public ContentBrowserClient { … };
class ServiceWorkerProcessManagerNonWebSchemeTest
: public ServiceWorkerProcessManagerTest { … };
TEST_F(ServiceWorkerProcessManagerNonWebSchemeTest,
NonWebSchemeWorkerCannotRequestOriginByDefault) { … }
TEST_F(ServiceWorkerProcessManagerNonWebSchemeTest,
WorkerCanBeGrantedAccessToScriptOrigin) { … }
}