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

Commit b283ec38 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

RESTRICT AUTOMERGE: Update tests to treat multithreaded_present as true

These tests were written or updated as if the multithreaded_present
flag is true, but may run on devices where it is not. Explicitly set the
flag to true so the tests always pass.

Conflicts:
- services/surfaceflinger/tests/unittests/SurfaceFlinger_FoldableTest.cpp

Bug: 323232586
Test: libsurfaceflinger_unittest
Change-Id: Ica7a921b5bf01b8eadac78900ac69f854f8a02de
Merged-In: Ica7a921b5bf01b8eadac78900ac69f854f8a02de
parent 338f61c5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -18,10 +18,14 @@
#define LOG_TAG "LibSurfaceFlingerUnittests"

#include "DisplayTransactionTestHelpers.h"
#include <com_android_graphics_surfaceflinger_flags.h>
#include <common/test/FlagUtils.h>

#include <gmock/gmock.h>
#include <gtest/gtest.h>

using namespace com::android::graphics::surfaceflinger;

namespace android {
namespace {

@@ -189,6 +193,7 @@ TEST_F(FoldableTest, requestsHardwareVsyncForBothDisplays) {
}

TEST_F(FoldableTest, requestVsyncOnPowerOn) {
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);
    EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kInnerDisplayId, true))
            .Times(1);
    EXPECT_CALL(mFlinger.scheduler()->mockRequestHardwareVsync, Call(kOuterDisplayId, true))
@@ -199,6 +204,7 @@ TEST_F(FoldableTest, requestVsyncOnPowerOn) {
}

TEST_F(FoldableTest, disableVsyncOnPowerOffPacesetter) {
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);
    // When the device boots, the inner display should be the pacesetter.
    ASSERT_EQ(mFlinger.scheduler()->pacesetterDisplayId(), kInnerDisplayId);

+9 −0
Original line number Diff line number Diff line
@@ -17,11 +17,15 @@
#undef LOG_TAG
#define LOG_TAG "LibSurfaceFlingerUnittests"

#include <com_android_graphics_surfaceflinger_flags.h>
#include <common/test/FlagUtils.h>
#include "DisplayTransactionTestHelpers.h"

#include <gmock/gmock.h>
#include <gtest/gtest.h>

using namespace com::android::graphics::surfaceflinger;

namespace android {
namespace {

@@ -453,6 +457,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToUnknownPrimaryDisplay
}

TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToOnExternalDisplay) {
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);
    transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOffToOnVariant>>();
}

@@ -461,6 +466,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOffToDozeSuspendExternalD
}

TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToOffExternalDisplay) {
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);
    transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToOffVariant>>();
}

@@ -473,6 +479,7 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeExternalDisplay)
}

TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToDozeExternalDisplay) {
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);
    transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToDozeVariant>>();
}

@@ -481,10 +488,12 @@ TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeToOnExternalDisplay)
}

TEST_F(SetPowerModeInternalTest, transitionsDisplayFromDozeSuspendToOnExternalDisplay) {
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);
    transitionDisplayCommon<ExternalDisplayPowerCase<TransitionDozeSuspendToOnVariant>>();
}

TEST_F(SetPowerModeInternalTest, transitionsDisplayFromOnToDozeSuspendExternalDisplay) {
    SET_FLAG_FOR_TEST(flags::multithreaded_present, true);
    transitionDisplayCommon<ExternalDisplayPowerCase<TransitionOnToDozeSuspendVariant>>();
}