#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 :
public GarbageCollected<TestLongTaskObserver>,
public LongTaskObserver { … };
class SelfUnregisteringObserver
: public GarbageCollected<SelfUnregisteringObserver>,
public LongTaskObserver { … };
}
class LongTaskDetectorTest : public testing::Test { … };
TEST_F(LongTaskDetectorTest, DeliversLongTaskNotificationOnlyWhenRegistered) { … }
TEST_F(LongTaskDetectorTest, DoesNotGetNotifiedOfShortTasks) { … }
TEST_F(LongTaskDetectorTest, RegisterSameObserverTwice) { … }
TEST_F(LongTaskDetectorTest, SelfUnregisteringObserver) { … }
}