chromium/third_party/blink/renderer/modules/service_worker/service_worker_event_queue_test.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 "third_party/blink/renderer/modules/service_worker/service_worker_event_queue.h"

#include <optional>

#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/test/test_mock_time_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_event_status.mojom-blink.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"

namespace blink {

namespace {

class MockEvent {};

base::RepeatingClosure CreateReceiverWithCalledFlag(bool* out_is_called) {}

}  // namespace

StayAwakeToken;

class ServiceWorkerEventQueueTest : public testing::Test {};

TEST_F(ServiceWorkerEventQueueTest, IdleTimer) {}

TEST_F(ServiceWorkerEventQueueTest, InflightEventBeforeStart) {}

TEST_F(ServiceWorkerEventQueueTest, EventTimer) {}

TEST_F(ServiceWorkerEventQueueTest, CustomTimeouts) {}

TEST_F(ServiceWorkerEventQueueTest, BecomeIdleAfterAbort) {}

TEST_F(ServiceWorkerEventQueueTest, AbortAllOnDestruction) {}

TEST_F(ServiceWorkerEventQueueTest, PushPendingTask) {}

TEST_F(ServiceWorkerEventQueueTest, PushPendingTaskWithOfflineEvent) {}

// Test that pending tasks are run when StartEvent() is called while there the
// idle event_queue.delay is zero. Regression test for https://crbug.com/878608.
TEST_F(ServiceWorkerEventQueueTest, RunPendingTasksWithZeroIdleTimerDelay) {}

TEST_F(ServiceWorkerEventQueueTest, SetIdleTimerDelayToZero) {}

TEST_F(ServiceWorkerEventQueueTest, EnqueueOffline) {}

TEST_F(ServiceWorkerEventQueueTest, IdleTimerWithOfflineEvents) {}

// Inflight or queued events must be aborted when event queue is destructed.
TEST_F(ServiceWorkerEventQueueTest, AbortNotStartedEventOnDestruction) {}

// Timer for timeout of each event starts when the event is queued.
TEST_F(ServiceWorkerEventQueueTest, TimeoutNotStartedEvent) {}

}  // namespace blink