chromium/third_party/blink/renderer/core/loader/long_task_detector_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/core/loader/long_task_detector.h"

#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"

namespace blink {

namespace {
class TestLongTaskObserver :
    // This has to be garbage collected since LongTaskObserver uses
    // GarbageCollectedMixin.
    public GarbageCollected<TestLongTaskObserver>,
    public LongTaskObserver {};

class SelfUnregisteringObserver
    : public GarbageCollected<SelfUnregisteringObserver>,
      public LongTaskObserver {};

}  // namespace

class LongTaskDetectorTest : public testing::Test {};

TEST_F(LongTaskDetectorTest, DeliversLongTaskNotificationOnlyWhenRegistered) {}

TEST_F(LongTaskDetectorTest, DoesNotGetNotifiedOfShortTasks) {}

TEST_F(LongTaskDetectorTest, RegisterSameObserverTwice) {}

TEST_F(LongTaskDetectorTest, SelfUnregisteringObserver) {}

}  // namespace blink