#include "cc/metrics/ukm_manager.h"
#include <utility>
#include <vector>
#include "base/ranges/algorithm.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "cc/metrics/begin_main_frame_metrics.h"
#include "cc/metrics/compositor_frame_reporter.h"
#include "cc/metrics/event_metrics.h"
#include "components/ukm/test_ukm_recorder.h"
#include "components/viz/common/frame_timing_details.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace cc {
namespace {
const char kTestUrl[] = …;
const int64_t kTestSourceId1 = …;
const char kCompositorLatency[] = …;
const char kEventLatency[] = …;
const char kMissedFrame[] = …;
const char kEventType[] = …;
const char kScrollInputType[] = …;
const char kGenerationToRendererCompositor[] = …;
const char kRendererCompositorQueueingDelay[] = …;
const char kRendererCompositorProcessing[] = …;
const char kRendererCompositorToMain[] = …;
const char kRendererMainProcessing[] = …;
const char kRendererMainFinishedToBeginImplFrame[] = …;
const char kBeginImplFrameToSendBeginMainFrame[] = …;
const char kSendBeginMainFrameToCommit[] = …;
const char kBlinkBreakdownHandleInputEvents[] = …;
const char kBlinkBreakdownAnimate[] = …;
const char kBlinkBreakdownStyleUpdate[] = …;
const char kBlinkBreakdownLayoutUpdate[] = …;
const char kBlinkBreakdownPrepaint[] = …;
const char kBlinkBreakdownCompositingInputs[] = …;
const char kBlinkBreakdownPaint[] = …;
const char kBlinkBreakdownCompositeCommit[] = …;
const char kBlinkBreakdownUpdateLayers[] = …;
const char kBlinkBreakdownBeginMainSentToStarted[] = …;
const char kCommit[] = …;
const char kEndCommitToActivation[] = …;
const char kActivation[] = …;
const char kEndActivateToSubmitCompositorFrame[] = …;
const char kSubmitCompositorFrameToPresentationCompositorFrame[] = …;
const char kVizBreakdownSubmitToReceiveCompositorFrame[] = …;
const char kVizBreakdownReceivedCompositorFrameToStartDraw[] = …;
const char kVizBreakdownStartDrawToSwapStart[] = …;
const char kVizBreakdownSwapStartToSwapEnd[] = …;
const char kVizBreakdownSwapStartToBufferAvailable[] = …;
const char kVizBreakdownBufferAvailableToBufferReady[] = …;
const char kVizBreakdownBufferReadyToLatch[] = …;
const char kVizBreakdownLatchToSwapEnd[] = …;
const char kVizBreakdownSwapEndToPresentationCompositorFrame[] = …;
const char kTotalLatency[] = …;
const char kCompositorAnimation[] = …;
const char kMainThreadAnimation[] = …;
const char kPinchZoom[] = …;
const char kRAF[] = …;
const char kScrollbarScroll[] = …;
const char kTouchScroll[] = …;
const char kVideo[] = …;
const char kWheelScroll[] = …;
class UkmManagerTest : public testing::Test { … };
class UkmManagerCompositorLatencyTest
: public UkmManagerTest,
public testing::WithParamInterface<
CompositorFrameReporter::FrameReportType> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(UkmManagerCompositorLatencyTest, CompositorLatency) { … }
TEST_F(UkmManagerTest, EventLatency) { … }
}
}