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

Commit 79e5f98d authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "Update tests to treat multithreaded_present as true" into main

parents 02c97164 6559d523
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -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 {


@@ -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))
@@ -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);


+9 −0
Original line number Original line Diff line number Diff line
@@ -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 {


@@ -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>>();
}
}


@@ -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>>();
}
}


@@ -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>>();
}
}


@@ -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>>();
}
}