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

Commit f466b19d authored by Rachel Lee's avatar Rachel Lee
Browse files

Fix infrequent comment in LayerHistoryTest

Fix some occurrences of outdated/incorrect comments saying layers turned
inactive, when actually they only turned infrequent. In the current
logic, layers can still be active when infrequent for other reasons.

Bug: none
Test: presubmit
Test: atest libsurfaceflinger_unittest
Change-Id: If65918a4732fda0d9c54412c7d7237f6e3812aa2
parent 69551238
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -506,7 +506,7 @@ TEST_F(LayerHistoryTest, oneLayerExplicitVote) {
    EXPECT_EQ(1, activeLayerCount());
    EXPECT_EQ(1, frequentLayerCount(time));

    // layer became inactive, but the vote stays
    // layer became infrequent, but the vote stays
    setDefaultLayerVote(layer.get(), LayerHistory::LayerVoteType::Heuristic);
    time += MAX_ACTIVE_LAYER_PERIOD_NS.count();
    ASSERT_EQ(1, summarizeLayerHistory(time).size());
@@ -540,7 +540,7 @@ TEST_F(LayerHistoryTest, oneLayerExplicitExactVote) {
    EXPECT_EQ(1, activeLayerCount());
    EXPECT_EQ(1, frequentLayerCount(time));

    // layer became inactive, but the vote stays
    // layer became infrequent, but the vote stays
    setDefaultLayerVote(layer.get(), LayerHistory::LayerVoteType::Heuristic);
    time += MAX_ACTIVE_LAYER_PERIOD_NS.count();
    ASSERT_EQ(1, summarizeLayerHistory(time).size());
@@ -692,7 +692,7 @@ TEST_F(LayerHistoryTest, oneLayerExplicitCategory) {
    EXPECT_EQ(0_Hz, summarizeLayerHistory(time)[0].desiredRefreshRate);
    EXPECT_EQ(FrameRateCategory::High, summarizeLayerHistory(time)[0].frameRateCategory);

    // layer became inactive, but the vote stays
    // layer became infrequent, but the vote stays
    setDefaultLayerVote(layer.get(), LayerHistory::LayerVoteType::Heuristic);
    time += MAX_ACTIVE_LAYER_PERIOD_NS.count();
    ASSERT_EQ(1, summarizeLayerHistory(time).size());
@@ -729,7 +729,7 @@ TEST_F(LayerHistoryTest, oneLayerCategoryNoPreference) {
    EXPECT_EQ(1, activeLayerCount());
    EXPECT_EQ(1, frequentLayerCount(time));

    // layer became inactive
    // layer became infrequent
    time += MAX_ACTIVE_LAYER_PERIOD_NS.count();
    EXPECT_EQ(1, summarizeLayerHistory(time).size());
    EXPECT_EQ(1, activeLayerCount());
@@ -770,7 +770,7 @@ TEST_F(LayerHistoryTest, oneLayerExplicitVoteWithCategory) {
    EXPECT_EQ(73.4_Hz, summarizeLayerHistory(time)[1].desiredRefreshRate);
    EXPECT_EQ(FrameRateCategory::Default, summarizeLayerHistory(time)[1].frameRateCategory);

    // layer became inactive, but the vote stays
    // layer became infrequent, but the vote stays
    setDefaultLayerVote(layer.get(), LayerHistory::LayerVoteType::Heuristic);
    time += MAX_ACTIVE_LAYER_PERIOD_NS.count();
    ASSERT_EQ(2, summarizeLayerHistory(time).size());
@@ -1175,7 +1175,7 @@ TEST_F(LayerHistoryTest, frontBufferedLayerVotesMax) {
    EXPECT_EQ(0, frequentLayerCount(time));
    EXPECT_EQ(0, animatingLayerCount(time));

    // layer became inactive
    // Layer still active due to front buffering, but it's infrequent.
    time += MAX_ACTIVE_LAYER_PERIOD_NS.count();
    ASSERT_EQ(1, summarizeLayerHistory(time).size());
    EXPECT_EQ(LayerHistory::LayerVoteType::Max, summarizeLayerHistory(time)[0].vote);