@@ -654,6 +654,72 @@ TEST_F(LayerHistoryIntegrationTest, oneLayerExplicitGte_nonVrr) {
654654 EXPECT_EQ (FrameRateCategory::Default, summarizeLayerHistory (time)[0 ].frameRateCategory );
655655}
656656
657+ TEST_F (LayerHistoryIntegrationTest, oneLayerGteNoVote_arr) {
658+ SET_FLAG_FOR_TEST (flags::arr_setframerate_gte_enum, true );
659+ // Set the test to be on a vrr mode.
660+ SET_FLAG_FOR_TEST (flags::vrr_config, true );
661+ mSelector ->setActiveMode (kVrrModeId , HI_FPS);
662+
663+ auto layer = createLegacyAndFrontedEndLayer (1 );
664+ showLayer (1 );
665+ setFrameRate (1 , (0_Hz).getValue (), ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_GTE,
666+ ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS);
667+
668+ EXPECT_EQ (1u , layerCount ());
669+ EXPECT_EQ (0u , activeLayerCount ());
670+
671+ nsecs_t time = systemTime ();
672+ for (size_t i = 0 ; i < PRESENT_TIME_HISTORY_SIZE; i++) {
673+ setBufferWithPresentTime (layer, time);
674+ time += HI_FPS_PERIOD;
675+ }
676+
677+ // Layer is active but GTE with 0 should be considered NoVote, thus nothing from summarize.
678+ ASSERT_EQ (0u , summarizeLayerHistory (time).size ());
679+ EXPECT_EQ (1u , activeLayerCount ());
680+ EXPECT_EQ (1 , frequentLayerCount (time));
681+
682+ // layer became inactive.
683+ setDefaultLayerVote (layer.get (), LayerHistory::LayerVoteType::Heuristic);
684+ time += MAX_ACTIVE_LAYER_PERIOD_NS.count ();
685+ ASSERT_EQ (0u , summarizeLayerHistory (time).size ());
686+ EXPECT_EQ (0u , activeLayerCount ());
687+ EXPECT_EQ (0 , frequentLayerCount (time));
688+ }
689+
690+ TEST_F (LayerHistoryIntegrationTest, oneLayerGteNoVote_mrr) {
691+ SET_FLAG_FOR_TEST (flags::arr_setframerate_gte_enum, true );
692+ // True by default on MRR devices as well, but the device is not set to VRR mode.
693+ SET_FLAG_FOR_TEST (flags::vrr_config, true );
694+
695+ auto layer = createLegacyAndFrontedEndLayer (1 );
696+ showLayer (1 );
697+ setFrameRate (1 , (0_Hz).getValue (), ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_GTE,
698+ ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS);
699+ setFrameRateCategory (1 , 0 );
700+
701+ EXPECT_EQ (1u , layerCount ());
702+ EXPECT_EQ (0u , activeLayerCount ());
703+
704+ nsecs_t time = systemTime ();
705+ for (size_t i = 0 ; i < PRESENT_TIME_HISTORY_SIZE; i++) {
706+ setBufferWithPresentTime (layer, time);
707+ time += HI_FPS_PERIOD;
708+ }
709+
710+ // Layer is active but GTE with 0 should be considered NoVote, thus nothing from summarize.
711+ ASSERT_EQ (0u , summarizeLayerHistory (time).size ());
712+ EXPECT_EQ (1u , activeLayerCount ());
713+ EXPECT_EQ (1 , frequentLayerCount (time));
714+
715+ // layer became inactive.
716+ setDefaultLayerVote (layer.get (), LayerHistory::LayerVoteType::Heuristic);
717+ time += MAX_ACTIVE_LAYER_PERIOD_NS.count ();
718+ ASSERT_EQ (0u , summarizeLayerHistory (time).size ());
719+ EXPECT_EQ (0u , activeLayerCount ());
720+ EXPECT_EQ (0 , frequentLayerCount (time));
721+ }
722+
657723TEST_F (LayerHistoryIntegrationTest, oneLayerExplicitVoteWithCategory_vrrFeatureOff) {
658724 SET_FLAG_FOR_TEST (flags::frame_rate_category_mrr, false );
659725
0 commit comments