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

Commit aee588c2 authored by Ben Widawsky's avatar Ben Widawsky
Browse files

SF: Improve refresh rate testing for FrameStats

This is useful to catch issues in fallback FPS calculations (which will
be introduced soon).

Bug: 382769837
Test: LayerTypeTransactionTests/LayerTypeTransactionTest.RefreshRateIsInitialized
Flag: com.android.graphics.surfaceflinger.flags.deprecate_frame_tracker
Change-Id: Iab91022ac3bd5afe1fa0adec26ef37788b043f14
parent 6bcac4c7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -192,7 +192,10 @@ TEST_P(LayerTypeTransactionTest, RefreshRateIsInitialized) {
    FrameStats frameStats;
    mClient->getLayerFrameStats(handle, &frameStats);

    ASSERT_GT(frameStats.refreshPeriodNano, static_cast<nsecs_t>(0));
    // 10000 FPS is a decent upper limit.
    ASSERT_GT(frameStats.refreshPeriodNano, static_cast<nsecs_t>(100000));
    // 1 FPS is an unlikely lower limit
    ASSERT_LT(frameStats.refreshPeriodNano, static_cast<nsecs_t>(1000000000));
}

} // namespace android