#include "content/browser/service_worker/service_worker_context_watcher.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration_options.mojom.h"
namespace content {
namespace {
void DidRegisterServiceWorker(int64_t* registration_id_out,
blink::ServiceWorkerStatusCode status,
const std::string& status_message,
int64_t registration_id) { … }
void DidUnregisterServiceWorker(blink::ServiceWorkerStatusCode* status_out,
blink::ServiceWorkerStatusCode status) { … }
class WatcherCallback { … };
}
class ServiceWorkerContextWatcherTest : public testing::Test { … };
TEST_F(ServiceWorkerContextWatcherTest, NoServiceWorker) { … }
TEST_F(ServiceWorkerContextWatcherTest, StoredServiceWorkers) { … }
TEST_F(ServiceWorkerContextWatcherTest, RegisteredServiceWorker) { … }
TEST_F(ServiceWorkerContextWatcherTest, UnregisteredServiceWorker) { … }
TEST_F(ServiceWorkerContextWatcherTest, ErrorReport) { … }
TEST_F(ServiceWorkerContextWatcherTest, StopQuickly) { … }
TEST_F(ServiceWorkerContextWatcherTest, Race) { … }
}