#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "cc/metrics/compositor_frame_reporting_controller.h"
#include <string>
#include <utility>
#include <vector>
#include "base/rand_util.h"
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/test_trace_processor.h"
#include "base/time/time.h"
#include "cc/metrics/dropped_frame_counter.h"
#include "cc/metrics/event_metrics.h"
#include "cc/metrics/total_frame_counter.h"
#include "cc/scheduler/commit_earlyout_reason.h"
#include "components/viz/common/frame_timing_details.h"
#include "components/viz/common/quads/compositor_frame_metadata.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/types/scroll_input_type.h"
namespace cc {
namespace {
Each;
IsEmpty;
NotNull;
SmoothEffectDrivingThread;
class TestCompositorFrameReportingController
: public CompositorFrameReportingController { … };
class CompositorFrameReportingControllerTest : public testing::Test { … };
TEST_F(CompositorFrameReportingControllerTest, ActiveReporterCounts) { … }
TEST_F(CompositorFrameReportingControllerTest,
StopRequestingFramesCancelsInFlightFrames) { … }
TEST_F(CompositorFrameReportingControllerTest,
SubmittedFrameHistogramReporting) { … }
TEST_F(CompositorFrameReportingControllerTest, MainFrameCausedNoDamage) { … }
TEST_F(CompositorFrameReportingControllerTest, DidNotProduceFrame) { … }
TEST_F(CompositorFrameReportingControllerTest,
DidNotProduceFrameDueToWaitingOnMain) { … }
TEST_F(CompositorFrameReportingControllerTest, MainFrameAborted) { … }
TEST_F(CompositorFrameReportingControllerTest, MainFrameAborted2) { … }
TEST_F(CompositorFrameReportingControllerTest, LongMainFrame) { … }
TEST_F(CompositorFrameReportingControllerTest, LongMainFrame2) { … }
TEST_F(CompositorFrameReportingControllerTest, BlinkBreakdown) { … }
TEST_F(CompositorFrameReportingControllerTest, ReportingMissedDeadlineFrame1) { … }
TEST_F(CompositorFrameReportingControllerTest, ReportingMissedDeadlineFrame2) { … }
TEST_F(CompositorFrameReportingControllerTest, LongCompositorAnimation) { … }
TEST_F(CompositorFrameReportingControllerTest, ReportingLatencyType) { … }
TEST_F(CompositorFrameReportingControllerTest,
EventLatencyTotalForPresentedFrameReported) { … }
TEST_F(CompositorFrameReportingControllerTest,
EventLatencyScrollTotalForPresentedFrameReported) { … }
TEST_F(CompositorFrameReportingControllerTest,
EventLatencyMainRepaintedScroll) { … }
TEST_F(CompositorFrameReportingControllerTest,
EventLatencyPinchTotalForPresentedFrameReported) { … }
TEST_F(CompositorFrameReportingControllerTest,
EventLatencyForDidNotPresentFrameReportedOnNextPresent) { … }
TEST_F(CompositorFrameReportingControllerTest,
NewMainUpdateIsNotPartialUpdate) { … }
TEST_F(CompositorFrameReportingControllerTest,
DependentDroppedFrameTerminatesReporterImmediately) { … }
TEST_F(CompositorFrameReportingControllerTest,
SkippedFramesFromDisplayCompositorAreDropped) { … }
TEST_F(CompositorFrameReportingControllerTest,
SkippedFramesFromDisplayCompositorAreDroppedUpToLimit) { … }
TEST_F(CompositorFrameReportingControllerTest,
CompositorFrameBlockedOnMainFrameWithNoDamage) { … }
TEST_F(CompositorFrameReportingControllerTest,
SkippedFramesFromDisplayCompositorHaveSmoothThread) { … }
TEST_F(CompositorFrameReportingControllerTest,
SkippedFramesFromClientRequestedThrottlingAreDropped) { … }
TEST_F(CompositorFrameReportingControllerTest,
DroppedFrameCountOnMainFrameAbort) { … }
TEST_F(CompositorFrameReportingControllerTest,
HandleOutOfOrderPresentationFeedback) { … }
TEST_F(CompositorFrameReportingControllerTest,
NewMainThreadUpdateNotReportedAsDropped) { … }
TEST_F(CompositorFrameReportingControllerTest,
NoUpdateCompositorWithJankyMain) { … }
TEST_F(CompositorFrameReportingControllerTest, MainFrameBeforeCommit) { … }
TEST_F(CompositorFrameReportingControllerTest,
ScrollJankMetricsPresentationOrderAbortedMain) { … }
TEST_F(CompositorFrameReportingControllerTest,
ScrollJankMetricsPresentationOrderDroppedPartialOnMainScroll) { … }
TEST_F(CompositorFrameReportingControllerTest,
ScrollJankMetricsPresentationOrderDroppedPartialOnImplScroll) { … }
TEST_F(CompositorFrameReportingControllerTest,
ScrollJankMetricsPresentationOrderReceivedDroppedEventsAreNotPassed) { … }
TEST_F(CompositorFrameReportingControllerTest, EmitsEventLatencyId) { … }
TEST_F(CompositorFrameReportingControllerTest, JankyScrolledFrameArg) { … }
TEST_F(CompositorFrameReportingControllerTest, VsyncIntervalArg) { … }
}
}