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

Commit cf4dec7e authored by Mina Granic's avatar Mina Granic
Browse files

Use a robot structure in CameraCompatFreeformPolicyTests.

Also use doReturn().when() pattern everywhere.

Flag: EXEMPT tests only
Fixes: 384465100
Fixes: 397557131
Test: atest WmTests:CameraCompatFreeformPolicyTests
Change-Id: If5bceac54705994ab76384b43f63143b2119db86
parent 5aedb9f4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -243,6 +243,11 @@ class AppCompatActivityRobot {
                .getAspectRatioOverrides()).getUserMinAspectRatio();
    }

    void setShouldRefreshActivityForCameraCompat(boolean enabled) {
        doReturn(enabled).when(mActivityStack.top().mAppCompatController.getCameraOverrides())
                .shouldRefreshActivityForCameraCompat();
    }

    void setIgnoreOrientationRequest(boolean enabled) {
        mDisplayContent.setIgnoreOrientationRequest(enabled);
    }
+13 −0
Original line number Diff line number Diff line
@@ -64,6 +64,19 @@ class AppCompatConfigurationRobot {
                .isCameraCompatTreatmentEnabledAtBuildTime();
    }

    void setCameraCompatAspectRatio(float aspectRatio) {
        doReturn(aspectRatio).when(mAppCompatConfiguration).getCameraCompatAspectRatio();
    }

    void enableCameraCompatRefresh(boolean enabled) {
        doReturn(enabled).when(mAppCompatConfiguration).isCameraCompatRefreshEnabled();
    }

    void enableCameraCompatRefreshCycleThroughStop(boolean enabled) {
        doReturn(enabled).when(mAppCompatConfiguration)
                .isCameraCompatRefreshCycleThroughStopEnabled();
    }

    void enableUserAppAspectRatioFullscreen(boolean enabled) {
        doReturn(enabled).when(mAppCompatConfiguration).isUserAppAspectRatioFullscreenEnabled();
    }
+479 −394

File changed.

Preview size limit exceeded, changes collapsed.