Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 000dd016 authored by Dan Stoza's avatar Dan Stoza
Browse files

SF: Add test for FrameStats refresh rate

Adds a Transaction_test to ensure that the refresh rate field of
FrameStats is properly initialized. This is also caught by CTS, but
adding the test here should avoid a long round-trip time.

Bug: 111854867
Test: Manual, test catches regression fixed by ag/4663082
Change-Id: I4db5fba6a05dbcd5d8566dd215756e0c49bd1053
parent b1a4e00a
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1422,6 +1422,19 @@ TEST_P(LayerTypeTransactionTest, SetOverrideScalingModeBasic) {
    }
}

TEST_P(LayerTypeTransactionTest, RefreshRateIsInitialized) {
    sp<SurfaceControl> layer;
    ASSERT_NO_FATAL_FAILURE(layer = createLayer("test", 32, 32));

    sp<IBinder> handle = layer->getHandle();
    ASSERT_TRUE(handle != nullptr);

    FrameStats frameStats;
    mClient->getLayerFrameStats(handle, &frameStats);

    ASSERT_GT(frameStats.refreshPeriodNano, static_cast<nsecs_t>(0));
}

TEST_F(LayerTransactionTest, SetCropBasic_BufferQueue) {
    sp<SurfaceControl> layer;
    ASSERT_NO_FATAL_FAILURE(layer = createLayer("test", 32, 32));