#include "content/browser/service_worker/service_worker_device_delegate_observer_unittest.h"
#include <cstdint>
#include "base/files/scoped_temp_dir.h"
#include "base/test/test_future.h"
#include "components/services/storage/public/mojom/service_worker_database.mojom-shared.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_device_delegate_observer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/service_worker/embedded_worker_status.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"
namespace content {
namespace {
TestFuture;
Pair;
UnorderedElementsAre;
RegistrationAndVersionPair;
class MockServiceWorkerDeviceDelegateObserver
: public ServiceWorkerDeviceDelegateObserver { … };
void RegisterServiceWorkerDeviceDelegateObserver(
MockServiceWorkerDeviceDelegateObserver& mock,
int64_t registration_id,
bool has_event_handlers,
const blink::StorageKey& key) { … }
}
ServiceWorkerDeviceDelegateObserverTest::
ServiceWorkerDeviceDelegateObserverTest()
: … { … }
ServiceWorkerDeviceDelegateObserverTest::
~ServiceWorkerDeviceDelegateObserverTest() = default;
void ServiceWorkerDeviceDelegateObserverTest::SetUp() { … }
void ServiceWorkerDeviceDelegateObserverTest::TearDown() { … }
scoped_refptr<ServiceWorkerRegistration>
ServiceWorkerDeviceDelegateObserverTest::InstallServiceWorker(
const GURL& origin) { … }
void ServiceWorkerDeviceDelegateObserverTest::ServiceWorkerInstalling(
scoped_refptr<ServiceWorkerVersion> version) { … }
void ServiceWorkerDeviceDelegateObserverTest::InitializeTestHelper() { … }
void ServiceWorkerDeviceDelegateObserverTest::StoreRegistration(
const RegistrationAndVersionPair& pair) { … }
TEST_F(ServiceWorkerDeviceDelegateObserverTest,
DispatchEventNoLiveRegistration) { … }
TEST_F(ServiceWorkerDeviceDelegateObserverTest, DispatchEventLiveRegistration) { … }
TEST_F(ServiceWorkerDeviceDelegateObserverTest,
DispatchEventCannotFindRegistration) { … }
TEST_F(ServiceWorkerDeviceDelegateObserverTest, DispatchEventStartWorkerFail) { … }
TEST_F(ServiceWorkerDeviceDelegateObserverTest, UpdateHasEventHandlers) { … }
}