chromium/content/browser/service_worker/embedded_worker_test_helper.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/service_worker/embedded_worker_test_helper.h"

#include <string>
#include <vector>

#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/test_future.h"
#include "components/services/storage/service_worker/service_worker_storage_control_impl.h"
#include "content/browser/loader/reconnectable_url_loader_factory.h"
#include "content/browser/loader/url_loader_factory_utils.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/policy_container_utils.h"
#include "content/public/test/test_browser_context.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "services/network/public/cpp/url_loader_factory_builder.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "storage/browser/test/mock_special_storage_policy.h"
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"

namespace content {

namespace {

void CreateURLLoaderFactory(
    mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {}

}  // namespace

EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(
    const base::FilePath& user_data_directory)
    :{}

EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(
    const base::FilePath& user_data_directory,
    scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy)
    :{}

EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(
    const base::FilePath& user_data_directory,
    std::unique_ptr<BrowserContext> browser_context)
    :{}

EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(
    const base::FilePath& user_data_directory,
    scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy,
    std::unique_ptr<BrowserContext> browser_context)
    :{}

void EmbeddedWorkerTestHelper::AddPendingInstanceClient(
    std::unique_ptr<FakeEmbeddedWorkerInstanceClient> client) {}

void EmbeddedWorkerTestHelper::AddPendingServiceWorker(
    std::unique_ptr<FakeServiceWorker> service_worker) {}

void EmbeddedWorkerTestHelper::OnInstanceClientReceiver(
    mojo::PendingReceiver<blink::mojom::EmbeddedWorkerInstanceClient>
        receiver) {}

void EmbeddedWorkerTestHelper::OnInstanceClientRequest(
    mojo::ScopedMessagePipeHandle request_handle) {}

void EmbeddedWorkerTestHelper::OnServiceWorkerRequest(
    mojo::PendingReceiver<blink::mojom::ServiceWorker> receiver) {}

void EmbeddedWorkerTestHelper::OnServiceWorkerReceiver(
    mojo::PendingReceiver<blink::mojom::ServiceWorker> receiver) {}

void EmbeddedWorkerTestHelper::RemoveInstanceClient(
    FakeEmbeddedWorkerInstanceClient* instance_client) {}

void EmbeddedWorkerTestHelper::RemoveServiceWorker(
    FakeServiceWorker* service_worker) {}

EmbeddedWorkerTestHelper::~EmbeddedWorkerTestHelper() {}

ServiceWorkerContextCore* EmbeddedWorkerTestHelper::context() {}

void EmbeddedWorkerTestHelper::ShutdownContext() {}

void EmbeddedWorkerTestHelper::SimulateStorageRestartForTesting() {}

// static
std::unique_ptr<ServiceWorkerVersion::MainScriptResponse>
EmbeddedWorkerTestHelper::CreateMainScriptResponse() {}

scoped_refptr<network::SharedURLLoaderFactory>
EmbeddedWorkerTestHelper::GetNetworkFactory() {}

void EmbeddedWorkerTestHelper::PopulateScriptCacheMap(
    int64_t version_id,
    base::OnceClosure callback) {}

std::unique_ptr<FakeEmbeddedWorkerInstanceClient>
EmbeddedWorkerTestHelper::CreateInstanceClient() {}

std::unique_ptr<FakeServiceWorker>
EmbeddedWorkerTestHelper::CreateServiceWorker() {}

void EmbeddedWorkerTestHelper::BindStorageControl(
    mojo::PendingReceiver<storage::mojom::ServiceWorkerStorageControl>
        receiver) {}

EmbeddedWorkerTestHelper::RegistrationAndVersionPair
EmbeddedWorkerTestHelper::PrepareRegistrationAndVersion(
    const GURL& scope,
    const GURL& script_url) {}

// Calls worker->Start() and runs until the start IPC is sent.
//
// Expects success. For failure cases, call Start() manually.
void EmbeddedWorkerTestHelper::StartWorkerUntilStartSent(
    EmbeddedWorkerInstance* worker,
    blink::mojom::EmbeddedWorkerStartParamsPtr params) {}

// Calls worker->Start() and runs until startup finishes.
//
// Expects success. For failure cases, call Start() manually.
void EmbeddedWorkerTestHelper::StartWorker(
    EmbeddedWorkerInstance* worker,
    blink::mojom::EmbeddedWorkerStartParamsPtr params) {}

blink::mojom::EmbeddedWorkerStartParamsPtr
EmbeddedWorkerTestHelper::CreateStartParams(
    scoped_refptr<ServiceWorkerVersion> version) {}

blink::mojom::ServiceWorkerProviderInfoForStartWorkerPtr
EmbeddedWorkerTestHelper::CreateProviderInfo(
    scoped_refptr<ServiceWorkerVersion> version) {}

mojo::PendingReceiver<blink::mojom::ServiceWorker>
EmbeddedWorkerTestHelper::CreateServiceWorker(
    scoped_refptr<ServiceWorkerVersion> version) {}

mojo::PendingReceiver<blink::mojom::ControllerServiceWorker>
EmbeddedWorkerTestHelper::CreateController() {}

blink::mojom::ServiceWorkerInstalledScriptsInfoPtr
EmbeddedWorkerTestHelper::GetInstalledScriptsInfoPtr() {}

}  // namespace content