8#include "gtest/gtest.h"
13TEST(VariableRefreshRateDisplayTest, ReportCorrectInitialRefreshRate) {
14 auto refresh_rate_reporter = std::make_shared<TestRefreshRateReporter>(60);
16 0, std::weak_ptr<TestRefreshRateReporter>(refresh_rate_reporter), 600,
18 ASSERT_EQ(display.GetRefreshRate(), 60);
21TEST(VariableRefreshRateDisplayTest, ReportCorrectRefreshRateWhenUpdated) {
22 auto refresh_rate_reporter = std::make_shared<TestRefreshRateReporter>(60);
24 0, std::weak_ptr<TestRefreshRateReporter>(refresh_rate_reporter), 600,
26 refresh_rate_reporter->UpdateRefreshRate(30);
27 ASSERT_EQ(display.GetRefreshRate(), 30);
30TEST(VariableRefreshRateDisplayTest,
31 Report0IfReporterSharedPointerIsDestroyedAfterDisplayCreation) {
32 auto refresh_rate_reporter = std::make_shared<TestRefreshRateReporter>(60);
34 0, std::weak_ptr<TestRefreshRateReporter>(refresh_rate_reporter), 600,
36 refresh_rate_reporter.reset();
37 ASSERT_EQ(display.GetRefreshRate(), 0);
40TEST(VariableRefreshRateDisplayTest,
41 Report0IfReporterSharedPointerIsDestroyedBeforeDisplayCreation) {
42 auto refresh_rate_reporter = std::make_shared<TestRefreshRateReporter>(60);
43 refresh_rate_reporter.reset();
45 0, std::weak_ptr<TestRefreshRateReporter>(refresh_rate_reporter), 600,
47 ASSERT_EQ(display.GetRefreshRate(), 0);
A Display where the refresh rate can change over time.
TEST(DisplayListComplexity, EmptyDisplayList)