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

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

Moved SSG tests to surfacecontrol cts

Some remaining test and helper classes were still under windowmanager
cts. Move these files to surfacecontrol so all tests in the same area
are together.

Test: CTS tests
Bug: 282169297
Change-Id: Ib42a8014478c77b9790d4f88044a9a547dbf3653
parent 921ae05c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@

        <activity android:name="com.android.server.wm.SurfaceControlViewHostTests$TestActivity" />

        <activity android:name="android.server.wm.scvh.SurfaceSyncGroupActivity"
        <activity android:name="com.android.server.wm.SurfaceSyncGroupTests$TestActivity"
            android:screenOrientation="locked"
            android:turnScreenOn="true"
            android:theme="@style/WhiteBackgroundTheme"
+29 −4
Original line number Diff line number Diff line
@@ -23,22 +23,27 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import android.app.Activity;
import android.app.Instrumentation;
import android.app.KeyguardManager;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.platform.test.annotations.Presubmit;
import android.server.wm.scvh.SurfaceSyncGroupActivity;
import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.cts.surfacevalidator.BitmapPixelChecker;
import android.widget.FrameLayout;
import android.window.SurfaceSyncGroup;

import androidx.annotation.Nullable;
import androidx.test.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;

@@ -56,10 +61,10 @@ public class SurfaceSyncGroupTests {
    private static final long TIMEOUT_S = HW_TIMEOUT_MULTIPLIER * 5L;

    @Rule
    public ActivityTestRule<SurfaceSyncGroupActivity> mActivityRule = new ActivityTestRule<>(
            SurfaceSyncGroupActivity.class);
    public ActivityTestRule<TestActivity> mActivityRule = new ActivityTestRule<>(
            TestActivity.class);

    private SurfaceSyncGroupActivity mActivity;
    private TestActivity mActivity;

    Instrumentation mInstrumentation;

@@ -187,4 +192,24 @@ public class SurfaceSyncGroupTests {

        swBitmap.recycle();
    }

    public static class TestActivity extends Activity {
        private ViewGroup mParentView;

        @Override
        public void onCreate(@Nullable Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);


            mParentView = new FrameLayout(this);
            setContentView(mParentView);

            KeyguardManager km = getSystemService(KeyguardManager.class);
            km.requestDismissKeyguard(this, null);
        }

        public View getBackgroundView() {
            return mParentView;
        }
    }
}