chromium/cc/metrics/frame_sequence_tracker_unittest.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "cc/metrics/frame_sequence_tracker.h"

#include <string>
#include <utility>
#include <vector>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "cc/metrics/compositor_frame_reporting_controller.h"
#include "cc/metrics/frame_sequence_tracker_collection.h"
#include "cc/metrics/frame_sorter.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/presentation_feedback.h"

namespace cc {

namespace {

const char* ParseNumber(const char* str, uint64_t* retvalue) {}

}  // namespace

class FrameSequenceTrackerTest : public testing::Test {};

// Tests that the tracker works correctly when the source-id for the
// begin-frames change.
TEST_F(FrameSequenceTrackerTest, SourceIdChangeDuringSequence) {}

TEST_F(FrameSequenceTrackerTest, TestNotifyFramePresented) {}

TEST_F(FrameSequenceTrackerTest, ReportMetricsAtFixedInterval) {}

TEST_F(FrameSequenceTrackerTest, MainFrameNoDamageTracking) {}

TEST_F(FrameSequenceTrackerTest, SimpleSequenceOneFrame) {}

TEST_F(FrameSequenceTrackerTest, SimpleSequenceOneFrameNoDamage) {}

TEST_F(FrameSequenceTrackerTest, MultipleNoDamageNotifications) {}

TEST_F(FrameSequenceTrackerTest, MultipleNoDamageNotificationsFromMain) {}

TEST_F(FrameSequenceTrackerTest, DelayedMainFrameNoDamage) {}

TEST_F(FrameSequenceTrackerTest, DelayedMainFrameNoDamageFromOlderFrame) {}

// This tests when a BeginMainFrame leads to No Damage, after the next Main
// Frame has started. This should not crash.
TEST_F(FrameSequenceTrackerTest, DelayedMainFrameNoDamageAfterNextMainFrame) {}

TEST_F(FrameSequenceTrackerTest, StateResetDuringSequence) {}

TEST_F(FrameSequenceTrackerTest, SequenceStateResetsDuringFrame) {}

// b(2417)B(0,2417)E(2417)n(2417)N(2417,2417)
TEST_F(FrameSequenceTrackerTest, SequenceNumberReset) {}

TEST_F(FrameSequenceTrackerTest, MainThroughputWithHighLatency) {}

TEST_F(FrameSequenceTrackerTest, TrackLastImplFrame1) {}

// All the following cases are for one complete impl + one incomplete:
// b(1)e(1,0)xxxxxxxxP(1)
// The 'xxxxx' is an incomplete impl frame that has no damage, it could be
// 1. b(2)e(2,0)P(1)n(2), and StopSequence happens anywhere after e and
//    before P.
// 2. b(2)e(2,0)P(1)n(2), and StopSequence can happen anywhere after e and
//    before P. In this case, the tracker is not ready for termination yet at P
//    because the sorted n(2) has not been called yet.
TEST_F(FrameSequenceTrackerTest, TrackLastImplFrame10) {}

TEST_F(FrameSequenceTrackerTest, TrackLastImplFrame11) {}

// This test ensure that the tracker would terminate at e.
TEST_F(FrameSequenceTrackerTest, TrackLastImplFrame24) {}

// Termination is triggered after a new tree is committed and activated. Due to
// this we will have started a BeginImplFrame that is not actually a part of the
// sequence. When this occurs we terminate as soon as the most recently
// submitted frame has bee processed.
TEST_F(FrameSequenceTrackerTest, IgnoreImplFrameBeforeTermination) {}

TEST_F(FrameSequenceTrackerTest, TerminationWithNullPresentationTimeStamp) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage1) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage2) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage3) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage4) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage5) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage6) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage7) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage8) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage9) {}

TEST_F(FrameSequenceTrackerTest, OffScreenMainDamage10) {}

// A presentation with a frame token that is > the main frame token submitted.
TEST_F(FrameSequenceTrackerTest, MainThreadPresentWithNonMatchedToken) {}

TEST_F(FrameSequenceTrackerTest, CoalescedMainThreadPresent) {}

TEST_F(FrameSequenceTrackerTest, MainThreadPresentWithNullTimeStamp) {}

TEST_F(FrameSequenceTrackerTest, TrackerTypeEncoding) {}

TEST_F(FrameSequenceTrackerTest, CustomTrackers) {}

TEST_F(FrameSequenceTrackerTest, CustomTrackerOutOfOrderFramesMissingV3Data) {}

}  // namespace cc