#include "content/browser/background_fetch/background_fetch_test_base.h"
#include <stdint.h>
#include <map>
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/check_deref.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/time/time.h"
#include "content/browser/background_fetch/background_fetch_registration_id.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_thread.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/mojom/service_worker/service_worker_registration_options.mojom.h"
#include "url/gurl.h"
namespace content {
namespace {
const char kTestOrigin[] = …;
void DidRegisterServiceWorker(int64_t* out_service_worker_registration_id,
base::OnceClosure quit_closure,
blink::ServiceWorkerStatusCode status,
const std::string& status_message,
int64_t service_worker_registration_id) { … }
void DidFindServiceWorkerRegistration(
scoped_refptr<ServiceWorkerRegistration>* out_service_worker_registration,
base::OnceClosure quit_closure,
blink::ServiceWorkerStatusCode status,
scoped_refptr<ServiceWorkerRegistration> service_worker_registration) { … }
void DidUnregisterServiceWorker(base::OnceClosure quit_closure,
blink::ServiceWorkerStatusCode status) { … }
GURL GetScopeForId(const std::string& origin, int64_t id) { … }
}
BackgroundFetchTestBase::BackgroundFetchTestBase()
: … { … }
BackgroundFetchTestBase::~BackgroundFetchTestBase() { … }
void BackgroundFetchTestBase::SetUp() { … }
void BackgroundFetchTestBase::TearDown() { … }
int64_t BackgroundFetchTestBase::RegisterServiceWorker() { … }
int64_t BackgroundFetchTestBase::RegisterServiceWorkerForOrigin(
const url::Origin& origin) { … }
void BackgroundFetchTestBase::UnregisterServiceWorker(
int64_t service_worker_registration_id) { … }
blink::mojom::FetchAPIRequestPtr
BackgroundFetchTestBase::CreateRequestWithProvidedResponse(
const std::string& method,
const GURL& url,
std::unique_ptr<TestResponse> response) { … }
blink::mojom::BackgroundFetchRegistrationDataPtr
BackgroundFetchTestBase::CreateBackgroundFetchRegistrationData(
const std::string& developer_id,
blink::mojom::BackgroundFetchResult result,
blink::mojom::BackgroundFetchFailureReason failure_reason) { … }
DevToolsBackgroundServicesContextImpl&
BackgroundFetchTestBase::devtools_context() { … }
}