#include "cc/metrics/scroll_jank_dropped_frame_tracker.h"
#include <memory>
#include <string>
#include <vector>
#include "base/strings/strcat.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_tick_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
namespace {
constexpr base::TimeDelta kVsyncInterval = …;
struct FrameTimestamps { … };
constexpr int kHistogramEmitFrequency = …;
constexpr int kFirstWindowSize = …;
constexpr const char* kDelayedFramesWindowHistogram = …;
constexpr const char* kMissedVsyncsWindowHistogram = …;
constexpr const char* kDelayedFramesPerScrollHistogram = …;
constexpr const char* kMissedVsyncsPerScrollHistogram = …;
constexpr const char* kMissedVsyncsSumInWindowHistogram = …;
constexpr const char* kMissedVsyncsSumInVsyncWindowHistogram = …;
constexpr const char* kMissedVsyncsMaxInWindowHistogram = …;
constexpr const char* kMissedVsyncsMaxInVsyncWindowHistogram = …;
constexpr const char* kMissedVsyncsSumPerScrollHistogram = …;
constexpr const char* kMissedVsyncsMaxPerScrollHistogram = …;
constexpr const char* kMissedVsyncsPerFrameHistogram = …;
}
class ScrollJankDroppedFrameTrackerTest : public testing::Test { … };
TEST_F(ScrollJankDroppedFrameTrackerTest, EmitsHistograms) { … }
TEST_F(ScrollJankDroppedFrameTrackerTest, FrameProducedEveryVsync) { … }
TEST_F(ScrollJankDroppedFrameTrackerTest, NoFrameProducedForMissingInput) { … }
TEST_F(ScrollJankDroppedFrameTrackerTest, MissedVsyncWhenInputWasPresent) { … }
TEST_F(ScrollJankDroppedFrameTrackerTest, MissedVsyncsPerVsyncWindow) { … }
struct ScrollTestCase { … };
class PerScrollTests : public ScrollJankDroppedFrameTrackerTest,
public testing::WithParamInterface<ScrollTestCase> { … };
TEST_P(PerScrollTests, MetricsEmittedPerScroll) { … }
TEST_P(PerScrollTests, VsyncMetricsEmittedPerScroll) { … }
INSTANTIATE_TEST_SUITE_P(…);
}