Loading services/surfaceflinger/tests/unittests/SurfaceFlinger_FoldableTest.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,15 @@ #undef LOG_TAG #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" #define LOG_TAG "LibSurfaceFlingerUnittests" #include <com_android_graphics_surfaceflinger_flags.h> #include <common/test/FlagUtils.h> #include "DualDisplayTransactionTest.h" #include "DualDisplayTransactionTest.h" #include <gmock/gmock.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <gtest/gtest.h> using namespace com::android::graphics::surfaceflinger; namespace android { namespace android { namespace { namespace { Loading Loading @@ -163,6 +167,7 @@ TEST_F(FoldableTest, requestsHardwareVsyncForBothDisplays) { } } TEST_F(FoldableTest, requestVsyncOnPowerOn) { TEST_F(FoldableTest, requestVsyncOnPowerOn) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kInnerDisplayId, true)) EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kInnerDisplayId, true)) .Times(1); .Times(1); EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kOuterDisplayId, true)) EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kOuterDisplayId, true)) Loading @@ -173,6 +178,7 @@ TEST_F(FoldableTest, requestVsyncOnPowerOn) { } } TEST_F(FoldableTest, disableVsyncOnPowerOffPacesetter) { TEST_F(FoldableTest, disableVsyncOnPowerOffPacesetter) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); // When the device boots, the inner display should be the pacesetter. // When the device boots, the inner display should be the pacesetter. ASSERT_EQ(mFlinger.scheduler()->pacesetterDisplayId(), kInnerDisplayId); ASSERT_EQ(mFlinger.scheduler()->pacesetterDisplayId(), kInnerDisplayId); Loading services/surfaceflinger/tests/unittests/SurfaceFlinger_SetPowerModeInternalTest.cpp +9 −0 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,15 @@ #undef LOG_TAG #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" #define LOG_TAG "LibSurfaceFlingerUnittests" #include <com_android_graphics_surfaceflinger_flags.h> #include <common/test/FlagUtils.h> #include "DisplayTransactionTestHelpers.h" #include "DisplayTransactionTestHelpers.h" #include <gmock/gmock.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <gtest/gtest.h> using namespace com::android::graphics::surfaceflinger; namespace android { namespace android { namespace { namespace { Loading Loading @@ -453,6 +457,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToUnknownPrimaryDisplay } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToOnExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToOnExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOffToOnVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOffToOnVariant>>(); } } Loading @@ -461,6 +466,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToDozeSuspendExternalD } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToOffExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToOffExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToOffVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToOffVariant>>(); } } Loading @@ -473,6 +479,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeExternalDisplay) } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToDozeExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToDozeExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToDozeVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToDozeVariant>>(); } } Loading @@ -481,10 +488,12 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeToOnExternalDisplay) } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToOnExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToOnExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToOnVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToOnVariant>>(); } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeSuspendExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeSuspendExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToDozeSuspendVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToDozeSuspendVariant>>(); } } Loading Loading
services/surfaceflinger/tests/unittests/SurfaceFlinger_FoldableTest.cpp +6 −0 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,15 @@ #undef LOG_TAG #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" #define LOG_TAG "LibSurfaceFlingerUnittests" #include <com_android_graphics_surfaceflinger_flags.h> #include <common/test/FlagUtils.h> #include "DualDisplayTransactionTest.h" #include "DualDisplayTransactionTest.h" #include <gmock/gmock.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <gtest/gtest.h> using namespace com::android::graphics::surfaceflinger; namespace android { namespace android { namespace { namespace { Loading Loading @@ -163,6 +167,7 @@ TEST_F(FoldableTest, requestsHardwareVsyncForBothDisplays) { } } TEST_F(FoldableTest, requestVsyncOnPowerOn) { TEST_F(FoldableTest, requestVsyncOnPowerOn) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kInnerDisplayId, true)) EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kInnerDisplayId, true)) .Times(1); .Times(1); EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kOuterDisplayId, true)) EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kOuterDisplayId, true)) Loading @@ -173,6 +178,7 @@ TEST_F(FoldableTest, requestVsyncOnPowerOn) { } } TEST_F(FoldableTest, disableVsyncOnPowerOffPacesetter) { TEST_F(FoldableTest, disableVsyncOnPowerOffPacesetter) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); // When the device boots, the inner display should be the pacesetter. // When the device boots, the inner display should be the pacesetter. ASSERT_EQ(mFlinger.scheduler()->pacesetterDisplayId(), kInnerDisplayId); ASSERT_EQ(mFlinger.scheduler()->pacesetterDisplayId(), kInnerDisplayId); Loading
services/surfaceflinger/tests/unittests/SurfaceFlinger_SetPowerModeInternalTest.cpp +9 −0 Original line number Original line Diff line number Diff line Loading @@ -17,11 +17,15 @@ #undef LOG_TAG #undef LOG_TAG #define LOG_TAG "LibSurfaceFlingerUnittests" #define LOG_TAG "LibSurfaceFlingerUnittests" #include <com_android_graphics_surfaceflinger_flags.h> #include <common/test/FlagUtils.h> #include "DisplayTransactionTestHelpers.h" #include "DisplayTransactionTestHelpers.h" #include <gmock/gmock.h> #include <gmock/gmock.h> #include <gtest/gtest.h> #include <gtest/gtest.h> using namespace com::android::graphics::surfaceflinger; namespace android { namespace android { namespace { namespace { Loading Loading @@ -453,6 +457,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToUnknownPrimaryDisplay } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToOnExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToOnExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOffToOnVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOffToOnVariant>>(); } } Loading @@ -461,6 +466,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToDozeSuspendExternalD } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToOffExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToOffExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToOffVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToOffVariant>>(); } } Loading @@ -473,6 +479,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeExternalDisplay) } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToDozeExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToDozeExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToDozeVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToDozeVariant>>(); } } Loading @@ -481,10 +488,12 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeToOnExternalDisplay) } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToOnExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToOnExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToOnVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToOnVariant>>(); } } TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeSuspendExternalDisplay) { TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeSuspendExternalDisplay) { SET_FLAG_FOR_TEST(flags::multithreaded_present, true); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToDozeSuspendVariant>>(); transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToDozeSuspendVariant>>(); } } Loading