1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.server.wm; 18 19 import static android.server.wm.WindowManagerState.getLogicalDisplaySize; 20 21 import android.platform.test.annotations.Presubmit; 22 import android.view.cts.surfacevalidator.CapturedActivity; 23 24 import androidx.test.rule.ActivityTestRule; 25 26 import org.junit.Before; 27 import org.junit.Rule; 28 import org.junit.Test; 29 import org.junit.rules.TestName; 30 31 @Presubmit 32 public class SurfaceSyncGroupContinuousTest { 33 @Rule 34 public TestName mName = new TestName(); 35 36 @Rule 37 public ActivityTestRule<CapturedActivity> mActivityRule = 38 new ActivityTestRule<>(CapturedActivity.class); 39 40 public CapturedActivity mCapturedActivity; 41 42 @Before setup()43 public void setup() { 44 mCapturedActivity = mActivityRule.getActivity(); 45 mCapturedActivity.setLogicalDisplaySize(getLogicalDisplaySize()); 46 } 47 48 @Test testSurfaceControlViewHostIPCSync_Fast()49 public void testSurfaceControlViewHostIPCSync_Fast() throws Throwable { 50 mCapturedActivity.verifyTest( 51 new SyncValidatorSCVHTestCase(0 /* delayMs */, false /* inProcess */), mName); 52 } 53 54 @Test testSurfaceControlViewHostIPCSync_Slow()55 public void testSurfaceControlViewHostIPCSync_Slow() throws Throwable { 56 mCapturedActivity.verifyTest( 57 new SyncValidatorSCVHTestCase(100 /* delayMs */, false /* inProcess */), mName); 58 } 59 60 @Test 61 @Presubmit testSurfaceControlViewHostSyncInProcess()62 public void testSurfaceControlViewHostSyncInProcess() throws Throwable { 63 mCapturedActivity.verifyTest( 64 new SyncValidatorSCVHTestCase(0 /* delayMs */, true /* inProcess */), mName); 65 } 66 } 67