Loading services/tests/wmtests/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ <uses-permission android:name="android.permission.MANAGE_USERS" /> <uses-permission android:name="android.permission.STORAGE_INTERNAL" /> <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" /> <uses-permission android:name="android.permission.STATUS_BAR_SERVICE" /> <application android:testOnly="true"> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" /> Loading services/tests/wmtests/src/com/android/server/policy/DummyPolicyTests.javadeleted 100644 → 0 +0 −46 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.policy; import android.platform.test.annotations.Presubmit; import org.junit.Test; import androidx.test.filters.FlakyTest; /** * Dummy test for com.android.server.policy. * TODO(b/113800711): Remove this class once the actual tests are moved from servicestests. */ public class DummyPolicyTests { @Presubmit @Test public void preSubmitTest() {} @FlakyTest @Presubmit @Test public void flakyPreSubmitTest() {} @Test public void postSubmitTest() {} @FlakyTest @Test public void flakyPostSubmitTest() {} } services/tests/servicestests/src/com/android/server/policy/FakeWindowState.java→services/tests/wmtests/src/com/android/server/policy/FakeWindowState.java +4 −6 Original line number Diff line number Diff line Loading @@ -16,17 +16,13 @@ package com.android.server.policy; import android.annotation.Nullable; import android.graphics.Point; import android.graphics.Rect; import android.util.proto.ProtoOutputStream; import android.view.Display; import android.view.DisplayCutout; import android.view.IApplicationToken; import android.view.WindowManager; import com.android.server.wm.WindowFrames; import com.android.server.wm.utils.WmDisplayCutout; public class FakeWindowState implements WindowManagerPolicy.WindowState { Loading Loading @@ -243,7 +239,9 @@ public class FakeWindowState implements WindowManagerPolicy.WindowState { } @Override public boolean canReceiveKeys() { return false; } public boolean canReceiveKeys() { return false; } @Override public void writeIdentifierToProto(ProtoOutputStream proto, long fieldId) { Loading services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java→services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java +13 −12 Original line number Diff line number Diff line Loading @@ -29,15 +29,16 @@ import android.view.Display; import android.view.DisplayInfo; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ErrorCollector; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) /** * Build/Install/Run: * atest WmTests:PhoneWindowManagerInsetsTest */ @SmallTest @Presubmit public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { Loading @@ -52,7 +53,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void portrait() throws Exception { public void portrait() { DisplayInfo di = displayInfoForRotation(ROTATION_0, false /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); Loading @@ -61,7 +62,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void portrait_withCutout() throws Exception { public void portrait_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_0, true /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); Loading @@ -70,7 +71,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void landscape() throws Exception { public void landscape() { DisplayInfo di = displayInfoForRotation(ROTATION_90, false /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); Loading @@ -79,7 +80,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void landscape_withCutout() throws Exception { public void landscape_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_90, true /* withCutout */); verifyStableInsets(di, DISPLAY_CUTOUT_HEIGHT, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); Loading @@ -88,7 +89,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void seascape() throws Exception { public void seascape() { DisplayInfo di = displayInfoForRotation(ROTATION_270, false /* withCutout */); verifyStableInsets(di, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, 0, 0); Loading @@ -97,7 +98,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void seascape_withCutout() throws Exception { public void seascape_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_270, true /* withCutout */); verifyStableInsets(di, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, DISPLAY_CUTOUT_HEIGHT, 0); Loading @@ -106,7 +107,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void upsideDown() throws Exception { public void upsideDown() { DisplayInfo di = displayInfoForRotation(ROTATION_180, false /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); Loading @@ -115,7 +116,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void upsideDown_withCutout() throws Exception { public void upsideDown_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_180, true /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT + DISPLAY_CUTOUT_HEIGHT); Loading services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java→services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java +8 −7 Original line number Diff line number Diff line Loading @@ -43,13 +43,14 @@ import android.view.DisplayCutout; import android.view.WindowManager; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) /** * Build/Install/Run: * atest WmTests:PhoneWindowManagerLayoutTest */ @SmallTest @Presubmit public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { Loading @@ -69,7 +70,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { } @Test public void layoutWindowLw_appDrawsBars() throws Exception { public void layoutWindowLw_appDrawsBars() { mAppWindow.attrs.flags |= FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; mPolicy.addWindow(mAppWindow); Loading @@ -84,7 +85,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { } @Test public void layoutWindowLw_appWontDrawBars() throws Exception { public void layoutWindowLw_appWontDrawBars() { mAppWindow.attrs.flags &= ~FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; mPolicy.addWindow(mAppWindow); Loading @@ -99,7 +100,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { } @Test public void layoutWindowLw_appWontDrawBars_forceStatus() throws Exception { public void layoutWindowLw_appWontDrawBars_forceStatus() { mAppWindow.attrs.flags &= ~FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; mAppWindow.attrs.privateFlags |= PRIVATE_FLAG_FORCE_DRAW_STATUS_BAR_BACKGROUND; mPolicy.addWindow(mAppWindow); Loading Loading
services/tests/wmtests/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ <uses-permission android:name="android.permission.MANAGE_USERS" /> <uses-permission android:name="android.permission.STORAGE_INTERNAL" /> <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" /> <uses-permission android:name="android.permission.STATUS_BAR_SERVICE" /> <application android:testOnly="true"> <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" /> Loading
services/tests/wmtests/src/com/android/server/policy/DummyPolicyTests.javadeleted 100644 → 0 +0 −46 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.policy; import android.platform.test.annotations.Presubmit; import org.junit.Test; import androidx.test.filters.FlakyTest; /** * Dummy test for com.android.server.policy. * TODO(b/113800711): Remove this class once the actual tests are moved from servicestests. */ public class DummyPolicyTests { @Presubmit @Test public void preSubmitTest() {} @FlakyTest @Presubmit @Test public void flakyPreSubmitTest() {} @Test public void postSubmitTest() {} @FlakyTest @Test public void flakyPostSubmitTest() {} }
services/tests/servicestests/src/com/android/server/policy/FakeWindowState.java→services/tests/wmtests/src/com/android/server/policy/FakeWindowState.java +4 −6 Original line number Diff line number Diff line Loading @@ -16,17 +16,13 @@ package com.android.server.policy; import android.annotation.Nullable; import android.graphics.Point; import android.graphics.Rect; import android.util.proto.ProtoOutputStream; import android.view.Display; import android.view.DisplayCutout; import android.view.IApplicationToken; import android.view.WindowManager; import com.android.server.wm.WindowFrames; import com.android.server.wm.utils.WmDisplayCutout; public class FakeWindowState implements WindowManagerPolicy.WindowState { Loading Loading @@ -243,7 +239,9 @@ public class FakeWindowState implements WindowManagerPolicy.WindowState { } @Override public boolean canReceiveKeys() { return false; } public boolean canReceiveKeys() { return false; } @Override public void writeIdentifierToProto(ProtoOutputStream proto, long fieldId) { Loading
services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java→services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java +13 −12 Original line number Diff line number Diff line Loading @@ -29,15 +29,16 @@ import android.view.Display; import android.view.DisplayInfo; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ErrorCollector; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) /** * Build/Install/Run: * atest WmTests:PhoneWindowManagerInsetsTest */ @SmallTest @Presubmit public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { Loading @@ -52,7 +53,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void portrait() throws Exception { public void portrait() { DisplayInfo di = displayInfoForRotation(ROTATION_0, false /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); Loading @@ -61,7 +62,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void portrait_withCutout() throws Exception { public void portrait_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_0, true /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); Loading @@ -70,7 +71,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void landscape() throws Exception { public void landscape() { DisplayInfo di = displayInfoForRotation(ROTATION_90, false /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); Loading @@ -79,7 +80,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void landscape_withCutout() throws Exception { public void landscape_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_90, true /* withCutout */); verifyStableInsets(di, DISPLAY_CUTOUT_HEIGHT, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); Loading @@ -88,7 +89,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void seascape() throws Exception { public void seascape() { DisplayInfo di = displayInfoForRotation(ROTATION_270, false /* withCutout */); verifyStableInsets(di, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, 0, 0); Loading @@ -97,7 +98,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void seascape_withCutout() throws Exception { public void seascape_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_270, true /* withCutout */); verifyStableInsets(di, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, DISPLAY_CUTOUT_HEIGHT, 0); Loading @@ -106,7 +107,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void upsideDown() throws Exception { public void upsideDown() { DisplayInfo di = displayInfoForRotation(ROTATION_180, false /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); Loading @@ -115,7 +116,7 @@ public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { } @Test public void upsideDown_withCutout() throws Exception { public void upsideDown_withCutout() { DisplayInfo di = displayInfoForRotation(ROTATION_180, true /* withCutout */); verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT + DISPLAY_CUTOUT_HEIGHT); Loading
services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java→services/tests/wmtests/src/com/android/server/policy/PhoneWindowManagerLayoutTest.java +8 −7 Original line number Diff line number Diff line Loading @@ -43,13 +43,14 @@ import android.view.DisplayCutout; import android.view.WindowManager; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) /** * Build/Install/Run: * atest WmTests:PhoneWindowManagerLayoutTest */ @SmallTest @Presubmit public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { Loading @@ -69,7 +70,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { } @Test public void layoutWindowLw_appDrawsBars() throws Exception { public void layoutWindowLw_appDrawsBars() { mAppWindow.attrs.flags |= FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; mPolicy.addWindow(mAppWindow); Loading @@ -84,7 +85,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { } @Test public void layoutWindowLw_appWontDrawBars() throws Exception { public void layoutWindowLw_appWontDrawBars() { mAppWindow.attrs.flags &= ~FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; mPolicy.addWindow(mAppWindow); Loading @@ -99,7 +100,7 @@ public class PhoneWindowManagerLayoutTest extends PhoneWindowManagerTestBase { } @Test public void layoutWindowLw_appWontDrawBars_forceStatus() throws Exception { public void layoutWindowLw_appWontDrawBars_forceStatus() { mAppWindow.attrs.flags &= ~FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; mAppWindow.attrs.privateFlags |= PRIVATE_FLAG_FORCE_DRAW_STATUS_BAR_BACKGROUND; mPolicy.addWindow(mAppWindow); Loading