#include "third_party/blink/renderer/core/loader/interactive_detector.h"
#include "base/functional/callback_helpers.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "components/ukm/test_ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/events/message_event.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/core/testing/scoped_mock_overlay_scrollbars.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.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/task_environment.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 {
PageLoad;
class NetworkActivityCheckerForTest
: public InteractiveDetector::NetworkActivityChecker { … };
int NetworkActivityCheckerForTest::GetActiveConnections() { … }
class InteractiveDetectorTest : public testing::Test,
public ScopedMockOverlayScrollbars { … };
TEST_F(InteractiveDetectorTest, FCP_DCL_FcpDetect) { … }
TEST_F(InteractiveDetectorTest, DCL_FCP_FcpDetect) { … }
TEST_F(InteractiveDetectorTest, InstantDetectionAtFcpDetectIfPossible) { … }
TEST_F(InteractiveDetectorTest, FcpDetectFiresAfterLateLongTask) { … }
TEST_F(InteractiveDetectorTest, FCP_FcpDetect_DCL) { … }
TEST_F(InteractiveDetectorTest, LongTaskBeforeFCPDoesNotAffectTTI) { … }
TEST_F(InteractiveDetectorTest, DCLDoesNotResetTimer) { … }
TEST_F(InteractiveDetectorTest, DCL_FCP_FcpDetect_LT) { … }
TEST_F(InteractiveDetectorTest, DCL_FCP_LT_FcpDetect) { … }
TEST_F(InteractiveDetectorTest, FCP_FcpDetect_LT_DCL) { … }
TEST_F(InteractiveDetectorTest, DclIsMoreThan5sAfterFCP) { … }
TEST_F(InteractiveDetectorTest, NetworkBusyBlocksTTIEvenWhenMainThreadQuiet) { … }
TEST_F(InteractiveDetectorTest, LongEnoughQuietWindowBetweenFCPAndFcpDetect) { … }
TEST_F(InteractiveDetectorTest, NetworkBusyEndIsNotTTI) { … }
TEST_F(InteractiveDetectorTest, LateLongTaskWithLateFCPDetection) { … }
TEST_F(InteractiveDetectorTest, IntermittentNetworkBusyBlocksTTI) { … }
TEST_F(InteractiveDetectorTest, InvalidatingUserInput) { … }
TEST_F(InteractiveDetectorTest, TaskLongerThan5sBlocksTTI) { … }
TEST_F(InteractiveDetectorTest, LongTaskAfterTTIDoesNothing) { … }
TEST_F(InteractiveDetectorTest, TotalBlockingTimeZero) { … }
TEST_F(InteractiveDetectorTest, TotalBlockingTimeNonZero) { … }
TEST_F(InteractiveDetectorTest, TotalBlockingSingleTask) { … }
TEST_F(InteractiveDetectorTest, FirstInputDelayForClickOnMobile) { … }
TEST_F(InteractiveDetectorTest,
FirstInputDelayForClickOnDesktopWithFixEnabled) { … }
}