chromium/content/browser/service_worker/service_worker_context_watcher_unittest.cc

// Copyright 2017 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/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 {};

}  // namespace

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) {}

// This test checks that even if ServiceWorkerContextWatcher::Stop() is called
// quickly after Start() is called, the crash (crbug.com/727877) should not
// happen.
TEST_F(ServiceWorkerContextWatcherTest, StopQuickly) {}

// This test checks that any callbacks should not be executed after
// ServiceWorkerContextWatcher::Stop() is called.
TEST_F(ServiceWorkerContextWatcherTest, Race) {}

}  // namespace content