#include "cc/metrics/dropped_frame_counter.h"
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "build/chromeos_buildflags.h"
#include "cc/animation/animation_host.h"
#include "cc/metrics/custom_metrics_recorder.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_frame_info.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/layer_tree_test.h"
namespace cc {
namespace {
SmoothnessStrategy;
FrameInfo CreateStubFrameInfo(bool is_dropped) { … }
class TestCustomMetricsRecorder : public CustomMetricRecorder { … };
class DroppedFrameCounterTestBase : public LayerTreeTest { … };
class DroppedFrameCounterNoDropTest : public DroppedFrameCounterTestBase { … };
MULTI_THREAD_TEST_F(DroppedFrameCounterNoDropTest);
class DroppedFrameCounterMainDropsNoSmoothness
: public DroppedFrameCounterTestBase { … };
class DroppedFrameCounterMainDropsSmoothnessTest
: public DroppedFrameCounterTestBase { … };
class DroppedFrameCounterTest : public testing::Test { … };
class SmoothnessStrategyDroppedFrameCounterTest
: public DroppedFrameCounterTest,
public testing::WithParamInterface<SmoothnessStrategy> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(SmoothnessStrategyDroppedFrameCounterTest, SimplePattern1) { … }
TEST_P(SmoothnessStrategyDroppedFrameCounterTest, SimplePattern2) { … }
TEST_P(SmoothnessStrategyDroppedFrameCounterTest, IncompleteWindow) { … }
TEST_P(SmoothnessStrategyDroppedFrameCounterTest, MaxPercentDroppedChanges) { … }
TEST_F(DroppedFrameCounterTest, MaxPercentDroppedWithIdleFrames) { … }
TEST_F(DroppedFrameCounterTest, NoCrashForIntervalLargerThanWindow) { … }
TEST_P(SmoothnessStrategyDroppedFrameCounterTest, Percentile95WithIdleFrames) { … }
TEST_P(SmoothnessStrategyDroppedFrameCounterTest,
Percentile95WithIdleFramesWhileHidden) { … }
TEST_P(SmoothnessStrategyDroppedFrameCounterTest,
Percentile95WithIdleFramesThenHide) { … }
TEST_P(SmoothnessStrategyDroppedFrameCounterTest,
ResetPendingFramesUpdatesMaxPercentDroppedFrames) { … }
TEST_F(DroppedFrameCounterTest, ResetPendingFramesAccountingForPendingFrames) { … }
TEST_F(DroppedFrameCounterTest, Reset) { … }
TEST_F(DroppedFrameCounterTest, ConsistentSmoothnessRatings) { … }
TEST_F(DroppedFrameCounterTest, MovingSmoothnessRatings) { … }
TEST_F(DroppedFrameCounterTest, FramesInFlightWhenFcpReceived) { … }
TEST_F(DroppedFrameCounterTest, ForkedCompositorFrameReporter) { … }
TEST_F(DroppedFrameCounterTest, WorstSmoothnessTiming) { … }
TEST_F(DroppedFrameCounterTest, ReportOnEveryFrameForUI) { … }
}
}