chromium/third_party/blink/renderer/core/paint/timing/text_paint_timing_detector_test.cc

// Copyright 2018 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/paint/timing/text_paint_timing_detector.h"

#include "base/test/test_mock_time_task_runner.h"
#include "base/test/trace_event_analyzer.h"
#include "base/time/time.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/paint/timing/paint_timing_detector.h"
#include "third_party/blink/renderer/core/paint/timing/paint_timing_test_helper.h"
#include "third_party/blink/renderer/core/svg/svg_text_content_element.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {

class TextPaintTimingDetectorTest : public testing::Test {};

constexpr base::TimeDelta TextPaintTimingDetectorTest::kQuantumOfTime;

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_NoText) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_OneText) {}

TEST_F(TextPaintTimingDetectorTest, LaterSameSizeCandidate) {}

TEST_F(TextPaintTimingDetectorTest,
       LargestTextPaint_FontSizeChange_MultipleUpdates) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_TraceEvent_Candidate) {}

TEST_F(TextPaintTimingDetectorTest,
       LargestTextPaint_TraceEvent_Candidate_Frame) {}

TEST_F(TextPaintTimingDetectorTest, AggregationBySelfPaintingInlineElement) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_OpacityZero) {}

TEST_F(TextPaintTimingDetectorTest,
       NodeRemovedBeforeAssigningPresentationTime) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_LargestText) {}

TEST_F(TextPaintTimingDetectorTest, UpdateResultWhenCandidateChanged) {}

// There is a risk that a text that is just recorded is selected to be the
// metric candidate. The algorithm should skip the text record if its paint time
// hasn't been recorded yet.
TEST_F(TextPaintTimingDetectorTest, PendingTextIsLargest) {}

// The same node may be visited by recordText for twice before the paint time
// is set. In some previous design, this caused the node to be recorded twice.
TEST_F(TextPaintTimingDetectorTest, VisitSameNodeTwiceBeforePaintTimeIsSet) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_ReportFirstPaintTime) {}

TEST_F(TextPaintTimingDetectorTest,
       LargestTextPaint_IgnoreTextOutsideViewport) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_RemovedText) {}

TEST_F(TextPaintTimingDetectorTest,
       RemoveRecordFromAllContainerAfterTextRemoval) {}

TEST_F(TextPaintTimingDetectorTest,
       RemoveRecordFromAllContainerAfterRepeatedAttachAndDetach) {}

TEST_F(TextPaintTimingDetectorTest,
       DestroyLargestTextPaintMangerAfterUserInput) {}

TEST_F(TextPaintTimingDetectorTest, DoNotStopRecordingLCPAfterKeyUp) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_TextRecordAfterRemoval) {}

TEST_F(TextPaintTimingDetectorTest,
       LargestTextPaint_CompareVisualSizeNotActualSize) {}

TEST_F(TextPaintTimingDetectorTest, LargestTextPaint_CompareSizesAtFirstPaint) {}

TEST_F(TextPaintTimingDetectorTest, TreatEllipsisAsText) {}

TEST_F(TextPaintTimingDetectorTest, CaptureFileUploadController) {}

TEST_F(TextPaintTimingDetectorTest, CapturingListMarkers) {}

TEST_F(TextPaintTimingDetectorTest, CaptureSVGText) {}

// This is for comparison with the ClippedByViewport test.
TEST_F(TextPaintTimingDetectorTest, NormalTextUnclipped) {}

TEST_F(TextPaintTimingDetectorTest, ClippedByViewport) {}

TEST_F(TextPaintTimingDetectorTest, ClippedByParentVisibleRect) {}

TEST_F(TextPaintTimingDetectorTest, Iframe) {}

TEST_F(TextPaintTimingDetectorTest, Iframe_ClippedByViewport) {}

TEST_F(TextPaintTimingDetectorTest, SameSizeShouldNotBeIgnored) {}

TEST_F(TextPaintTimingDetectorTest, VisibleTextAfterUserInput) {}

TEST_F(TextPaintTimingDetectorTest, VisibleTextAfterUserScroll) {}

TEST_F(TextPaintTimingDetectorTest, OpacityZeroHTML) {}

TEST_F(TextPaintTimingDetectorTest, OpacityZeroHTML2) {}

}  // namespace blink