#include "content/test/test_background_sync_manager.h"
#include "base/functional/bind.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "content/browser/devtools/devtools_background_services_context_impl.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace content {
TestBackgroundSyncManager::TestBackgroundSyncManager(
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
DevToolsBackgroundServicesContextImpl& devtools_context)
: … { … }
TestBackgroundSyncManager::~TestBackgroundSyncManager() { … }
void TestBackgroundSyncManager::DoInit() { … }
void TestBackgroundSyncManager::ResumeBackendOperation() { … }
void TestBackgroundSyncManager::StoreDataInBackend(
int64_t sw_registration_id,
const url::Origin& origin,
const std::string& key,
const std::string& data,
ServiceWorkerRegistry::StatusCallback callback) { … }
void TestBackgroundSyncManager::GetDataFromBackend(
const std::string& key,
ServiceWorkerRegistry::GetUserDataForAllRegistrationsCallback callback) { … }
void TestBackgroundSyncManager::DispatchSyncEvent(
const std::string& tag,
scoped_refptr<ServiceWorkerVersion> active_version,
bool last_chance,
ServiceWorkerVersion::StatusCallback callback) { … }
void TestBackgroundSyncManager::DispatchPeriodicSyncEvent(
const std::string& tag,
scoped_refptr<ServiceWorkerVersion> active_version,
ServiceWorkerVersion::StatusCallback callback) { … }
void TestBackgroundSyncManager::HasMainFrameWindowClient(
const blink::StorageKey& key,
BoolCallback callback) { … }
void TestBackgroundSyncManager::FireReadyEvents(
blink::mojom::BackgroundSyncType sync_type,
bool reschedule,
base::OnceClosure callback,
std::unique_ptr<BackgroundSyncEventKeepAlive> keepalive) { … }
void TestBackgroundSyncManager::StoreDataInBackendContinue(
int64_t sw_registration_id,
const url::Origin& origin,
const std::string& key,
const std::string& data,
ServiceWorkerRegistry::StatusCallback callback) { … }
void TestBackgroundSyncManager::GetDataFromBackendContinue(
const std::string& key,
ServiceWorkerRegistry::GetUserDataForAllRegistrationsCallback callback) { … }
base::TimeDelta TestBackgroundSyncManager::GetSoonestWakeupDelta(
blink::mojom::BackgroundSyncType sync_type,
base::Time last_browser_wakeup_for_periodic_sync) { … }
}