#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) { … }
}
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_F(ServiceWorkerEventQueueTest, RunPendingTasksWithZeroIdleTimerDelay) { … }
TEST_F(ServiceWorkerEventQueueTest, SetIdleTimerDelayToZero) { … }
TEST_F(ServiceWorkerEventQueueTest, EnqueueOffline) { … }
TEST_F(ServiceWorkerEventQueueTest, IdleTimerWithOfflineEvents) { … }
TEST_F(ServiceWorkerEventQueueTest, AbortNotStartedEventOnDestruction) { … }
TEST_F(ServiceWorkerEventQueueTest, TimeoutNotStartedEvent) { … }
}