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

Commit cbec71d7 authored by Chavi Weingarten's avatar Chavi Weingarten
Browse files

Fix OutputTest when display_protected is flipped on

Test: libcompositionengine_test
Bug: 315382500
Change-Id: Ic49aca6f7598a578db4b1de7283556486a27ba27
parent b507b71c
Loading
Loading
Loading
Loading
+27 −9
Original line number Diff line number Diff line
@@ -4094,7 +4094,11 @@ struct OutputComposeSurfacesTest_HandlesProtectedContent : public OutputComposeS
};

TEST_F(OutputComposeSurfacesTest_HandlesProtectedContent, ifNoProtectedContentLayers) {
    if (FlagManager::getInstance().display_protected()) {
        mOutput.mState.isProtected = true;
    } else {
        mOutput.mState.isSecure = true;
    }
    mLayer2.mLayerFEState.hasProtectedContent = false;
    EXPECT_CALL(mRenderEngine, supportsProtectedContent()).WillRepeatedly(Return(true));
    EXPECT_CALL(*mRenderSurface, isProtected).WillOnce(Return(true));
@@ -4108,7 +4112,11 @@ TEST_F(OutputComposeSurfacesTest_HandlesProtectedContent, ifNoProtectedContentLa
}

TEST_F(OutputComposeSurfacesTest_HandlesProtectedContent, ifNotEnabled) {
    if (FlagManager::getInstance().display_protected()) {
        mOutput.mState.isProtected = true;
    } else {
        mOutput.mState.isSecure = true;
    }
    mLayer2.mLayerFEState.hasProtectedContent = true;
    EXPECT_CALL(mRenderEngine, supportsProtectedContent()).WillRepeatedly(Return(true));

@@ -4130,7 +4138,11 @@ TEST_F(OutputComposeSurfacesTest_HandlesProtectedContent, ifNotEnabled) {
}

TEST_F(OutputComposeSurfacesTest_HandlesProtectedContent, ifAlreadyEnabledEverywhere) {
    if (FlagManager::getInstance().display_protected()) {
        mOutput.mState.isProtected = true;
    } else {
        mOutput.mState.isSecure = true;
    }
    mLayer2.mLayerFEState.hasProtectedContent = true;
    EXPECT_CALL(mRenderEngine, supportsProtectedContent()).WillRepeatedly(Return(true));
    EXPECT_CALL(*mRenderSurface, isProtected).WillOnce(Return(true));
@@ -4143,7 +4155,11 @@ TEST_F(OutputComposeSurfacesTest_HandlesProtectedContent, ifAlreadyEnabledEveryw
}

TEST_F(OutputComposeSurfacesTest_HandlesProtectedContent, ifAlreadyEnabledInRenderSurface) {
    if (FlagManager::getInstance().display_protected()) {
        mOutput.mState.isProtected = true;
    } else {
        mOutput.mState.isSecure = true;
    }
    mLayer2.mLayerFEState.hasProtectedContent = true;
    EXPECT_CALL(mRenderEngine, supportsProtectedContent()).WillRepeatedly(Return(true));
    EXPECT_CALL(*mRenderSurface, isProtected).WillOnce(Return(true));
@@ -4222,6 +4238,7 @@ struct GenerateClientCompositionRequestsTest : public testing::Test {

    GenerateClientCompositionRequestsTest() {
        mOutput.mState.needsFiltering = false;
        mOutput.mState.isProtected = true;

        mOutput.setDisplayColorProfileForTest(
                std::unique_ptr<DisplayColorProfile>(mDisplayColorProfile));
@@ -4246,6 +4263,7 @@ struct GenerateClientCompositionRequestsTest_ThreeLayers
        mOutput.mState.displaySpace.setOrientation(kDisplayOrientation);
        mOutput.mState.needsFiltering = false;
        mOutput.mState.isSecure = false;
        mOutput.mState.isProtected = true;

        for (size_t i = 0; i < mLayers.size(); i++) {
            mLayers[i].mOutputLayerState.clearClientTarget = false;
@@ -4708,7 +4726,7 @@ TEST_F(GenerateClientCompositionRequestsTest_ThreeLayers,
            Region(kDisplayFrame),
            false, /* needs filtering */
            false, /* secure */
            true,  /* supports protected content */
            true,  /* isProtected */
            kDisplayViewport,
            kDisplayDataspace,
            true /* realContentIsVisible */,
@@ -4721,7 +4739,7 @@ TEST_F(GenerateClientCompositionRequestsTest_ThreeLayers,
            Region(kDisplayFrame),
            false, /* needs filtering */
            false, /* secure */
            true,  /* supports protected content */
            true,  /* isProtected */
            kDisplayViewport,
            kDisplayDataspace,
            true /* realContentIsVisible */,
@@ -4734,7 +4752,7 @@ TEST_F(GenerateClientCompositionRequestsTest_ThreeLayers,
            Region(kDisplayFrame),
            false, /* needs filtering */
            false, /* secure */
            true,  /* supports protected content */
            true,  /* isProtected */
            kDisplayViewport,
            kDisplayDataspace,
            true /* realContentIsVisible */,
@@ -4912,7 +4930,7 @@ TEST_F(GenerateClientCompositionRequestsTest, handlesLandscapeModeSplitScreenReq
            Region(Rect(0, 0, 1000, 1000)),
            false, /* needs filtering */
            true,  /* secure */
            true,  /* supports protected content */
            true,  /* isProtected */
            kPortraitViewport,
            kOutputDataspace,
            true /* realContentIsVisible */,
@@ -4931,7 +4949,7 @@ TEST_F(GenerateClientCompositionRequestsTest, handlesLandscapeModeSplitScreenReq
            Region(Rect(1000, 0, 2000, 1000)),
            false, /* needs filtering */
            true,  /* secure */
            true,  /* supports protected content */
            true,  /* isProtected */
            kPortraitViewport,
            kOutputDataspace,
            true /* realContentIsVisible */,