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

Commit 761bc2da authored by Su Hong Koo's avatar Su Hong Koo
Browse files

SF: Fix edge case in SchedulerTest related to pacesetter_selection

With the pacesetter_selection enabled, Scheduler calls
ISchedulerCallback::enableLayerCachingTexturePool(pacesetter, false) on
every demotePacesetterDisplay(). The scheduler's destructor makes a
demote call.

SchedulerTest#enablesLayerCachingTexturePoolForPacesetter test enables
the pacesetter_selection flag at the start, and at the end of the test
the flag resets to the default value.

When the flag is not enabled by default, the call to
enableLayerCachingTexturePool() by the Scheduler’s destructor won’t
happen. However, when it is enabled by default, the call is made. The
test case sets up EXPECT_CALL for enableLayerCachingTexturePool(). One
quirk of gmock is that if you mock a function, then you must mock all
calls being made to it, else the test fails. To avoid the Scheduler’s
destructor making an unexpected enableLayerCachingTexturePool() call
and failing the test when the flag is default-enabled, we flush the
mock’s expectations with VerifyAndClearExpectations() call at the end
of the test.

This CL also removes a redundant pacesetter_selection flag setup.

Flag: EXEMPT test fix
Bug: 389983418
Test: atest libsurfaceflinger_unittests with and without the flag
Change-Id: Ic0b671089e44fd337efbac3a03c9440defd561a4
parent 657953d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment