#include "components/viz/common/frame_sinks/begin_frame_source.h"
#include <stdint.h>
#include <memory>
#include <utility>
#include "base/memory/raw_ptr.h"
#include "base/test/test_mock_time_task_runner.h"
#include "components/viz/test/begin_frame_args_test.h"
#include "components/viz/test/begin_frame_source_test.h"
#include "components/viz/test/fake_delay_based_time_source.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
NiceMock;
_;
namespace viz {
namespace {
base::TimeTicks TicksFromMicroseconds(int64_t micros) { … }
TEST(BeginFrameSourceTest, SourceIdsAreUnique) { … }
class TestTaskRunner : public base::TestMockTimeTaskRunner { … };
class BackToBackBeginFrameSourceTest : public ::testing::Test { … };
const int64_t BackToBackBeginFrameSourceTest::kDeadline = …;
const int64_t BackToBackBeginFrameSourceTest::kInterval = …;
TEST_F(BackToBackBeginFrameSourceTest, AddObserverSendsBeginFrame) { … }
TEST_F(BackToBackBeginFrameSourceTest,
RemoveObserverThenDidFinishFrameProducesNoFrame) { … }
TEST_F(BackToBackBeginFrameSourceTest,
DidFinishFrameThenRemoveObserverProducesNoFrame) { … }
TEST_F(BackToBackBeginFrameSourceTest,
TogglingObserverThenDidFinishFrameProducesCorrectFrame) { … }
TEST_F(BackToBackBeginFrameSourceTest,
DidFinishFrameThenTogglingObserverProducesCorrectFrame) { … }
TEST_F(BackToBackBeginFrameSourceTest, DidFinishFrameNoObserver) { … }
TEST_F(BackToBackBeginFrameSourceTest, DidFinishFrameMultipleCallsIdempotent) { … }
TEST_F(BackToBackBeginFrameSourceTest, DelayInPostedTaskProducesCorrectFrame) { … }
TEST_F(BackToBackBeginFrameSourceTest, MultipleObserversSynchronized) { … }
TEST_F(BackToBackBeginFrameSourceTest, MultipleObserversInterleaved) { … }
TEST_F(BackToBackBeginFrameSourceTest, MultipleObserversAtOnce) { … }
TEST_F(BackToBackBeginFrameSourceTest, OnGpuNoLongerBusyWithNoObservers) { … }
class DelayBasedBeginFrameSourceTest : public ::testing::Test { … };
TEST_F(DelayBasedBeginFrameSourceTest,
AddObserverCallsOnBeginFrameWithMissedTick) { … }
TEST_F(DelayBasedBeginFrameSourceTest, AddObserverCallsCausesOnBeginFrame) { … }
TEST_F(DelayBasedBeginFrameSourceTest, BasicOperation) { … }
TEST_F(DelayBasedBeginFrameSourceTest, VSyncChanges) { … }
TEST_F(DelayBasedBeginFrameSourceTest, VSyncChangeTimebaseBeforeLastTick) { … }
TEST_F(DelayBasedBeginFrameSourceTest, VSyncChangeTimebaseAfterNextTick) { … }
TEST_F(DelayBasedBeginFrameSourceTest, VSyncChangeTimebaseBetweenTicks) { … }
TEST_F(DelayBasedBeginFrameSourceTest, VSyncSkipped) { … }
TEST_F(DelayBasedBeginFrameSourceTest, MultipleObservers) { … }
TEST_F(DelayBasedBeginFrameSourceTest, DoubleTick) { … }
TEST_F(DelayBasedBeginFrameSourceTest, DoubleTickMissedFrame) { … }
TEST_F(DelayBasedBeginFrameSourceTest, MultipleArgsInSameInterval) { … }
TEST_F(DelayBasedBeginFrameSourceTest, ConsecutiveArgsDelayedByMultipleVsyncs) { … }
TEST_F(DelayBasedBeginFrameSourceTest, WithVrrInterval) { … }
class MockExternalBeginFrameSourceClient
: public ExternalBeginFrameSourceClient { … };
class ExternalBeginFrameSourceTest : public ::testing::Test { … };
TEST_F(ExternalBeginFrameSourceTest, OnAnimateOnlyBeginFrameOptIn) { … }
TEST_F(ExternalBeginFrameSourceTest, OnBeginFrameChecksBeginFrameContinuity) { … }
TEST_F(ExternalBeginFrameSourceTest, GetMissedBeginFrameArgs) { … }
TEST_F(ExternalBeginFrameSourceTest, RootsNotifiedLast) { … }
}
}