Merge "Revert "DO NOT MERGE: Move AM/WM unit tests out of FrameworksServicesTests to WmTests""
This commit is contained in:
@@ -16,16 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
|
||||||
|
|
||||||
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
|
|
||||||
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import android.app.ActivityOptions;
|
import android.app.ActivityOptions;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
@@ -34,16 +24,26 @@ import android.support.test.filters.MediumTest;
|
|||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import com.android.server.am.LaunchParamsController.LaunchParams;
|
import com.android.server.am.LaunchParamsController.LaunchParams;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
|
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.Mockito.spy;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
|
||||||
|
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for exercising resizing bounds due to activity options.
|
* Tests for exercising resizing bounds due to activity options.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ActivityLaunchParamsModifierTests
|
* atest FrameworksServicesTests:ActivityLaunchParamsModifierTests
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -33,8 +33,17 @@ import org.mockito.MockitoAnnotations;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link ActivityManagerInternal}.
|
* Test class for {@link ActivityManagerInternal}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* To run the tests, use
|
||||||
* atest WmTests:ActivityManagerInternalTest
|
*
|
||||||
|
* runtest -c com.android.server.am.ActivityManagerInternalTest frameworks-services
|
||||||
|
*
|
||||||
|
* or the following steps:
|
||||||
|
*
|
||||||
|
* Build: m FrameworksServicesTests
|
||||||
|
* Install: adb install -r \
|
||||||
|
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
|
||||||
|
* Run: adb shell am instrument -e class com.android.server.am.ActivityManagerInternalTest -w \
|
||||||
|
* com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
|
||||||
*/
|
*/
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class ActivityManagerInternalTest {
|
public class ActivityManagerInternalTest {
|
||||||
@@ -28,7 +28,6 @@ import static android.app.ActivityManager.PROCESS_STATE_RECEIVER;
|
|||||||
import static android.app.ActivityManager.PROCESS_STATE_SERVICE;
|
import static android.app.ActivityManager.PROCESS_STATE_SERVICE;
|
||||||
import static android.app.ActivityManager.PROCESS_STATE_TOP;
|
import static android.app.ActivityManager.PROCESS_STATE_TOP;
|
||||||
import static android.util.DebugUtils.valueToString;
|
import static android.util.DebugUtils.valueToString;
|
||||||
|
|
||||||
import static com.android.server.am.ActivityManagerInternalTest.CustomThread;
|
import static com.android.server.am.ActivityManagerInternalTest.CustomThread;
|
||||||
import static com.android.server.am.ActivityManagerService.DISPATCH_UIDS_CHANGED_UI_MSG;
|
import static com.android.server.am.ActivityManagerService.DISPATCH_UIDS_CHANGED_UI_MSG;
|
||||||
import static com.android.server.am.ActivityManagerService.Injector;
|
import static com.android.server.am.ActivityManagerService.Injector;
|
||||||
@@ -89,8 +88,17 @@ import java.util.function.Function;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link ActivityManagerService}.
|
* Test class for {@link ActivityManagerService}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* To run the tests, use
|
||||||
* atest WmTests:ActivityManagerServiceTest
|
*
|
||||||
|
* runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
|
||||||
|
*
|
||||||
|
* or the following steps:
|
||||||
|
*
|
||||||
|
* Build: m FrameworksServicesTests
|
||||||
|
* Install: adb install -r \
|
||||||
|
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
|
||||||
|
* Run: adb shell am instrument -e class com.android.server.am.ActivityManagerServiceTest -w \
|
||||||
|
* com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -822,4 +830,4 @@ public class ActivityManagerServiceTest {
|
|||||||
mRestricted = restricted;
|
mRestricted = restricted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,18 +18,13 @@ package com.android.server.am;
|
|||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.app.IActivityManager;
|
import android.app.IActivityManager;
|
||||||
import android.os.RemoteException;
|
import android.os.ServiceManager;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
|
import android.os.RemoteException;
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link ActivityManager}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:ActivityManagerTest
|
|
||||||
*/
|
|
||||||
public class ActivityManagerTest extends AndroidTestCase {
|
public class ActivityManagerTest extends AndroidTestCase {
|
||||||
|
|
||||||
IActivityManager service;
|
IActivityManager service;
|
||||||
@@ -22,7 +22,11 @@ import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
|
|||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
|
||||||
import static android.view.Display.DEFAULT_DISPLAY;
|
import static android.view.Display.DEFAULT_DISPLAY;
|
||||||
|
|
||||||
|
import static com.android.server.am.ActivityStack.ActivityState.DESTROYED;
|
||||||
|
import static com.android.server.am.ActivityStack.ActivityState.DESTROYING;
|
||||||
|
import static com.android.server.am.ActivityStack.ActivityState.FINISHING;
|
||||||
import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING;
|
import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING;
|
||||||
|
import static com.android.server.am.ActivityStack.ActivityState.PAUSED;
|
||||||
import static com.android.server.am.ActivityStack.ActivityState.PAUSING;
|
import static com.android.server.am.ActivityStack.ActivityState.PAUSING;
|
||||||
import static com.android.server.am.ActivityStack.ActivityState.STOPPED;
|
import static com.android.server.am.ActivityStack.ActivityState.STOPPED;
|
||||||
import static com.android.server.am.ActivityStack.REMOVE_TASK_MODE_MOVING;
|
import static com.android.server.am.ActivityStack.REMOVE_TASK_MODE_MOVING;
|
||||||
@@ -53,16 +57,17 @@ import android.support.test.filters.MediumTest;
|
|||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.util.MutableBoolean;
|
import android.util.MutableBoolean;
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
import org.junit.Test;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link ActivityRecord} class.
|
* Tests for the {@link ActivityRecord} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:com.android.server.am.ActivityRecordTests
|
* atest FrameworksServicesTests:com.android.server.am.ActivityRecordTests
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -62,7 +62,7 @@ import java.util.ArrayList;
|
|||||||
* Tests for the {@link ActivityStackSupervisor} class.
|
* Tests for the {@link ActivityStackSupervisor} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ActivityStackSupervisorTests
|
* atest FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -33,9 +33,13 @@ import static org.junit.Assert.assertFalse;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
import static org.mockito.Mockito.anyInt;
|
import static org.mockito.Mockito.anyInt;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
@@ -43,15 +47,15 @@ import android.platform.test.annotations.Presubmit;
|
|||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link ActivityStack} class.
|
* Tests for the {@link ActivityStack} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ActivityStackTests
|
* atest FrameworksServicesTests:com.android.server.am.ActivityStackTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -19,13 +19,6 @@ package com.android.server.am;
|
|||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
|
|
||||||
import static org.mockito.Mockito.doReturn;
|
|
||||||
import static org.mockito.Mockito.eq;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.spy;
|
|
||||||
import static org.mockito.Mockito.times;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
@@ -34,8 +27,15 @@ import android.support.test.runner.AndroidJUnit4;
|
|||||||
import com.android.server.am.ActivityStackSupervisor.PendingActivityLaunch;
|
import com.android.server.am.ActivityStackSupervisor.PendingActivityLaunch;
|
||||||
import com.android.server.am.ActivityStarter.Factory;
|
import com.android.server.am.ActivityStarter.Factory;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.mockito.Mockito.doReturn;
|
||||||
|
import static org.mockito.Mockito.eq;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.spy;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ import java.util.Random;
|
|||||||
* Tests for the {@link ActivityStartController} class.
|
* Tests for the {@link ActivityStartController} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ActivityStartControllerTests
|
* atest FrameworksServicesTests:ActivityStartControllerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -55,7 +55,7 @@ import org.mockito.MockitoAnnotations;
|
|||||||
* Unit tests for {@link ActivityStartInterceptorTest}.
|
* Unit tests for {@link ActivityStartInterceptorTest}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* bit WmTests:ActivityStartInterceptorTest
|
* bit FrameworksServicesTests:com.android.server.am.ActivityStartInterceptorTest
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
public class ActivityStartInterceptorTest {
|
public class ActivityStartInterceptorTest {
|
||||||
@@ -32,26 +32,10 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||||
import static android.content.Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED;
|
|
||||||
|
|
||||||
import static com.android.server.am.ActivityManagerService.ANIMATE;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.mockito.Mockito.any;
|
|
||||||
import static org.mockito.Mockito.anyBoolean;
|
|
||||||
import static org.mockito.Mockito.anyInt;
|
|
||||||
import static org.mockito.Mockito.anyObject;
|
|
||||||
import static org.mockito.Mockito.doAnswer;
|
|
||||||
import static org.mockito.Mockito.doReturn;
|
|
||||||
import static org.mockito.Mockito.eq;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.spy;
|
|
||||||
import static org.mockito.Mockito.times;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
import android.app.ActivityOptions;
|
import android.app.ActivityOptions;
|
||||||
import android.app.IApplicationThread;
|
import android.app.IApplicationThread;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.ActivityInfo.WindowLayout;
|
import android.content.pm.ActivityInfo.WindowLayout;
|
||||||
@@ -66,18 +50,39 @@ import android.support.test.filters.SmallTest;
|
|||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static android.content.Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED;
|
||||||
|
import static com.android.server.am.ActivityManagerService.ANIMATE;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.Mockito.any;
|
||||||
|
import static org.mockito.Mockito.anyBoolean;
|
||||||
|
import static org.mockito.Mockito.anyInt;
|
||||||
|
import static org.mockito.Mockito.anyObject;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.doNothing;
|
||||||
|
import static org.mockito.Mockito.doReturn;
|
||||||
|
import static org.mockito.Mockito.eq;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.spy;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
|
||||||
import com.android.internal.os.BatteryStatsImpl;
|
import com.android.internal.os.BatteryStatsImpl;
|
||||||
|
import com.android.server.am.ActivityStarter.Factory;
|
||||||
import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
|
import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
|
||||||
import com.android.server.am.TaskRecord.TaskRecordFactory;
|
import com.android.server.am.TaskRecord.TaskRecordFactory;
|
||||||
|
|
||||||
import org.junit.Test;
|
import java.util.ArrayList;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link ActivityStarter} class.
|
* Tests for the {@link ActivityStarter} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ActivityStarterTests
|
* atest FrameworksServicesTests:ActivityStarterTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -21,17 +21,21 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
||||||
import static android.view.Display.DEFAULT_DISPLAY;
|
import static android.view.Display.DEFAULT_DISPLAY;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.doNothing;
|
||||||
|
import static org.mockito.Mockito.doReturn;
|
||||||
import static org.mockito.Mockito.any;
|
import static org.mockito.Mockito.any;
|
||||||
import static org.mockito.Mockito.anyBoolean;
|
import static org.mockito.Mockito.anyBoolean;
|
||||||
import static org.mockito.Mockito.anyInt;
|
import static org.mockito.Mockito.anyInt;
|
||||||
import static org.mockito.Mockito.doAnswer;
|
import static org.mockito.Mockito.doAnswer;
|
||||||
import static org.mockito.Mockito.doNothing;
|
|
||||||
import static org.mockito.Mockito.doReturn;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.spy;
|
import static org.mockito.Mockito.spy;
|
||||||
|
|
||||||
import android.app.ActivityOptions;
|
import android.app.ActivityOptions;
|
||||||
|
import com.android.server.wm.DisplayWindowController;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
|
|
||||||
import android.app.IApplicationThread;
|
import android.app.IApplicationThread;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -48,21 +52,20 @@ import android.service.voice.IVoiceInteractionSession;
|
|||||||
import android.support.test.InstrumentationRegistry;
|
import android.support.test.InstrumentationRegistry;
|
||||||
import android.testing.DexmakerShareClassLoaderRule;
|
import android.testing.DexmakerShareClassLoaderRule;
|
||||||
|
|
||||||
|
|
||||||
import com.android.internal.app.IVoiceInteractor;
|
import com.android.internal.app.IVoiceInteractor;
|
||||||
|
|
||||||
import com.android.server.AttributeCache;
|
import com.android.server.AttributeCache;
|
||||||
import com.android.server.wm.AppWindowContainerController;
|
import com.android.server.wm.AppWindowContainerController;
|
||||||
import com.android.server.wm.DisplayWindowController;
|
|
||||||
import com.android.server.wm.PinnedStackWindowController;
|
import com.android.server.wm.PinnedStackWindowController;
|
||||||
import com.android.server.wm.StackWindowController;
|
import com.android.server.wm.StackWindowController;
|
||||||
import com.android.server.wm.TaskWindowContainerController;
|
import com.android.server.wm.TaskWindowContainerController;
|
||||||
import com.android.server.wm.WindowManagerService;
|
import com.android.server.wm.WindowManagerService;
|
||||||
import com.android.server.wm.WindowTestUtils;
|
import com.android.server.wm.WindowTestUtils;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A base class to handle common operations in activity related unit tests.
|
* A base class to handle common operations in activity related unit tests.
|
||||||
@@ -32,10 +32,7 @@ import org.junit.runner.RunWith;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link AppErrorDialog}.
|
* runtest -c com.android.server.am.AppErrorDialogTest frameworks-services
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:AppErrorDialogTest
|
|
||||||
*/
|
*/
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@@ -62,8 +62,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* Note: Currently, we only support fetching the screenshot for the current application, so the
|
* Note: Currently, we only support fetching the screenshot for the current application, so the
|
||||||
* screenshot checks are hardcoded accordingly.
|
* screenshot checks are hardcoded accordingly.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
|
||||||
* atest WmTests:AssistDataRequesterTest
|
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* 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.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
@@ -31,12 +15,6 @@ import android.support.test.runner.AndroidJUnit4;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
|
||||||
* Test class for {@link ClientLifecycleManager}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:ClientLifecycleManagerTests
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -37,6 +37,7 @@ import com.android.server.AppOpsService;
|
|||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
@@ -47,8 +48,17 @@ import java.io.File;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link CoreSettingsObserver}.
|
* Test class for {@link CoreSettingsObserver}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* To run the tests, use
|
||||||
* atest WmTests:CoreSettingsObserverTest
|
*
|
||||||
|
* runtest -c com.android.server.am.CoreSettingsObserverTest frameworks-services
|
||||||
|
*
|
||||||
|
* or the following steps:
|
||||||
|
*
|
||||||
|
* Build: m FrameworksServicesTests
|
||||||
|
* Install: adb install -r \
|
||||||
|
* ${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk
|
||||||
|
* Run: adb shell am instrument -e class com.android.server.am.CoreSettingsObserverTest -w \
|
||||||
|
* com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -36,9 +36,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link GlobalSettingsToPropertiesMapper}
|
* Tests for {@link GlobalSettingsToPropertiesMapper}
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:GlobalSettingsToPropertiesMapperTest
|
|
||||||
*/
|
*/
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@@ -16,14 +16,20 @@
|
|||||||
|
|
||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
|
import android.app.ActivityOptions;
|
||||||
|
import android.content.pm.ActivityInfo.WindowLayout;
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.filters.MediumTest;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import com.android.server.am.LaunchParamsController.LaunchParams;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
|
||||||
|
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||||
|
|
||||||
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
|
|
||||||
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
|
|
||||||
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotEquals;
|
|
||||||
import static org.mockito.Mockito.any;
|
import static org.mockito.Mockito.any;
|
||||||
import static org.mockito.Mockito.anyInt;
|
import static org.mockito.Mockito.anyInt;
|
||||||
import static org.mockito.Mockito.doNothing;
|
import static org.mockito.Mockito.doNothing;
|
||||||
@@ -34,24 +40,18 @@ import static org.mockito.Mockito.spy;
|
|||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
import android.app.ActivityOptions;
|
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_DONE;
|
||||||
import android.content.pm.ActivityInfo.WindowLayout;
|
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_SKIP;
|
||||||
import android.support.test.filters.MediumTest;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import com.android.server.am.LaunchParamsController.LaunchParams;
|
import static org.junit.Assert.assertEquals;
|
||||||
import com.android.server.am.LaunchParamsController.LaunchParamsModifier;
|
import static org.junit.Assert.assertNotEquals;
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for exercising {@link LaunchParamsController}.
|
* Tests for exercising {@link LaunchParamsController}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:LaunchParamsControllerTests
|
* atest FrameworksServicesTests:LaunchParamsControllerTests
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -35,20 +35,9 @@ import static android.telecom.TelecomManager.EMERGENCY_DIALER_COMPONENT;
|
|||||||
import static com.android.server.am.LockTaskController.STATUS_BAR_MASK_LOCKED;
|
import static com.android.server.am.LockTaskController.STATUS_BAR_MASK_LOCKED;
|
||||||
import static com.android.server.am.LockTaskController.STATUS_BAR_MASK_PINNED;
|
import static com.android.server.am.LockTaskController.STATUS_BAR_MASK_PINNED;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.mockito.ArgumentMatchers.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.mockito.Mockito.*;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
|
||||||
import static org.mockito.ArgumentMatchers.anyString;
|
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
|
||||||
import static org.mockito.Mockito.doAnswer;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.never;
|
|
||||||
import static org.mockito.Mockito.reset;
|
|
||||||
import static org.mockito.Mockito.times;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
import android.app.admin.DevicePolicyManager;
|
import android.app.admin.DevicePolicyManager;
|
||||||
@@ -87,7 +76,7 @@ import org.mockito.verification.VerificationMode;
|
|||||||
* Unit tests for {@link LockTaskController}.
|
* Unit tests for {@link LockTaskController}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* bit WmTests:LockTaskControllerTest
|
* bit FrameworksServicesTests:com.android.server.am.LockTaskControllerTest
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static com.android.server.am.MemoryStatUtil.MemoryStat;
|
|
||||||
import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromMemcg;
|
import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromMemcg;
|
||||||
import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromProcfs;
|
import static com.android.server.am.MemoryStatUtil.parseMemoryStatFromProcfs;
|
||||||
|
import static com.android.server.am.MemoryStatUtil.MemoryStat;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
@@ -29,12 +29,6 @@ import android.support.test.runner.AndroidJUnit4;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link MemoryStatUtil}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:MemoryStatUtilTest
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
public class MemoryStatUtilTest {
|
public class MemoryStatUtilTest {
|
||||||
@@ -20,11 +20,14 @@ import static org.junit.Assert.assertEquals;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
|
|
||||||
|
import android.annotation.Nullable;
|
||||||
import android.app.ActivityOptions;
|
import android.app.ActivityOptions;
|
||||||
|
import android.os.Handler;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.FlakyTest;
|
import android.support.test.filters.FlakyTest;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
import android.util.ArrayMap;
|
||||||
import android.view.RemoteAnimationAdapter;
|
import android.view.RemoteAnimationAdapter;
|
||||||
|
|
||||||
import com.android.server.testutils.OffsettableClock;
|
import com.android.server.testutils.OffsettableClock;
|
||||||
@@ -37,10 +40,7 @@ import org.mockito.Mock;
|
|||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link PendingRemoteAnimationRegistry}.
|
* atest PendingRemoteAnimationRegistryTest
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:PendingRemoteAnimationRegistryTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
@@ -42,12 +41,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link PersistentConnection}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:PersistentConnectionTest
|
|
||||||
*/
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
public class PersistentConnectionTest extends AndroidTestCase {
|
public class PersistentConnectionTest extends AndroidTestCase {
|
||||||
private static class MyConnection extends PersistentConnection<IDeviceAdminService> {
|
private static class MyConnection extends PersistentConnection<IDeviceAdminService> {
|
||||||
@@ -35,12 +35,16 @@ import static org.junit.Assert.fail;
|
|||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
import static org.mockito.ArgumentMatchers.anyString;
|
import static org.mockito.ArgumentMatchers.anyString;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.spy;
|
||||||
|
|
||||||
import static java.lang.Integer.MAX_VALUE;
|
import static java.lang.Integer.MAX_VALUE;
|
||||||
|
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.app.ActivityManager.RecentTaskInfo;
|
import android.app.ActivityManager.RecentTaskInfo;
|
||||||
import android.app.ActivityManager.RunningTaskInfo;
|
import android.app.ActivityManager.RunningTaskInfo;
|
||||||
|
import android.app.WindowConfiguration;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -49,6 +53,7 @@ import android.content.pm.UserInfo;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Debug;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
@@ -75,10 +80,7 @@ import java.util.Random;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link RecentTasks}.
|
* atest FrameworksServicesTests:RecentTasksTest
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:RecentTasksTest
|
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,13 +16,15 @@
|
|||||||
|
|
||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
|
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
|
||||||
|
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||||
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
|
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
|
||||||
|
|
||||||
import static org.mockito.Mockito.any;
|
import static org.mockito.Mockito.any;
|
||||||
|
import static org.mockito.Mockito.anyInt;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
import static org.mockito.Mockito.eq;
|
import static org.mockito.Mockito.eq;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
@@ -37,18 +39,13 @@ import android.support.test.InstrumentationRegistry;
|
|||||||
import android.support.test.filters.MediumTest;
|
import android.support.test.filters.MediumTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.view.IRecentsAnimationRunner;
|
import android.view.IRecentsAnimationRunner;
|
||||||
|
|
||||||
import com.android.server.AttributeCache;
|
import com.android.server.AttributeCache;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link RecentsAnimation}.
|
* atest FrameworksServicesTests:RecentsAnimationTest
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:RecentsAnimationTest
|
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -41,11 +41,8 @@ import org.junit.runner.RunWith;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link RunningTasks}.
|
* runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:RunningTasksTest
|
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -126,4 +123,4 @@ public class RunningTasksTest extends ActivityTestsBase {
|
|||||||
.build();
|
.build();
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,12 +27,6 @@ import android.support.test.runner.AndroidJUnit4;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link SafeActivityOptions}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:SafeActivityOptionsTest
|
|
||||||
*/
|
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@FlakyTest
|
@FlakyTest
|
||||||
@@ -16,29 +16,37 @@
|
|||||||
|
|
||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
|
||||||
|
|
||||||
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import android.content.pm.ActivityInfo.WindowLayout;
|
import android.content.pm.ActivityInfo.WindowLayout;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.MediumTest;
|
import android.support.test.filters.MediumTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
|
|
||||||
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||||
|
|
||||||
|
import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.RESULT_CONTINUE;
|
||||||
|
|
||||||
|
import static org.mockito.Mockito.any;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for exercising resizing task bounds.
|
* Tests for exercising resizing task bounds.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:TaskLaunchParamsModifierTests
|
* atest FrameworksServicesTests:TaskLaunchParamsModifierTests
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -17,16 +17,20 @@
|
|||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import android.content.pm.UserInfo;
|
import android.content.pm.UserInfo;
|
||||||
|
import android.os.Environment;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
|
|
||||||
|
import com.android.server.am.TaskPersister;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link TaskPersister}.
|
* atest FrameworksServicesTests:TaskPersisterTest
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:TaskPersisterTest
|
|
||||||
*/
|
*/
|
||||||
public class TaskPersisterTest extends AndroidTestCase {
|
public class TaskPersisterTest extends AndroidTestCase {
|
||||||
private static final String TEST_USER_NAME = "AM-Test-User";
|
private static final String TEST_USER_NAME = "AM-Test-User";
|
||||||
@@ -29,16 +29,20 @@ import android.app.ActivityManager;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.res.XmlResourceParser;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.service.voice.IVoiceInteractionSession;
|
import android.service.voice.IVoiceInteractionSession;
|
||||||
|
import android.support.test.InstrumentationRegistry;
|
||||||
import android.support.test.filters.MediumTest;
|
import android.support.test.filters.MediumTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
|
|
||||||
|
import com.android.frameworks.servicestests.R;
|
||||||
import com.android.internal.app.IVoiceInteractor;
|
import com.android.internal.app.IVoiceInteractor;
|
||||||
import com.android.server.am.TaskRecord.TaskRecordFactory;
|
import com.android.server.am.TaskRecord.TaskRecordFactory;
|
||||||
|
|
||||||
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -53,13 +57,15 @@ import java.io.FileReader;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for exercising {@link TaskRecord}.
|
* Tests for exercising {@link TaskRecord}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:TaskRecordTests
|
* atest FrameworksServicesTests:com.android.server.am.TaskRecordTests
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
@@ -33,30 +32,23 @@ import android.content.ComponentName;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.res.Resources.Theme;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.support.test.InstrumentationRegistry;
|
import android.support.test.InstrumentationRegistry;
|
||||||
import android.support.test.filters.MediumTest;
|
import android.support.test.filters.MediumTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.support.test.uiautomator.UiDevice;
|
import android.support.test.uiautomator.UiDevice;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Pair;
|
||||||
import com.android.internal.annotations.GuardedBy;
|
import com.android.internal.annotations.GuardedBy;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link TaskStackListener}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:TaskStackChangedListenerTest
|
|
||||||
*/
|
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class TaskStackChangedListenerTest {
|
public class TaskStackChangedListenerTest {
|
||||||
@@ -16,30 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.am;
|
package com.android.server.am;
|
||||||
|
|
||||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
|
||||||
import static android.testing.DexmakerShareClassLoaderRule.runWithDexmakerShareClassLoader;
|
|
||||||
|
|
||||||
import static com.android.server.am.UserController.CONTINUE_USER_SWITCH_MSG;
|
|
||||||
import static com.android.server.am.UserController.REPORT_LOCKED_BOOT_COMPLETE_MSG;
|
|
||||||
import static com.android.server.am.UserController.REPORT_USER_SWITCH_COMPLETE_MSG;
|
|
||||||
import static com.android.server.am.UserController.REPORT_USER_SWITCH_MSG;
|
|
||||||
import static com.android.server.am.UserController.SYSTEM_USER_CURRENT_MSG;
|
|
||||||
import static com.android.server.am.UserController.SYSTEM_USER_START_MSG;
|
|
||||||
import static com.android.server.am.UserController.USER_SWITCH_TIMEOUT_MSG;
|
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.anyString;
|
|
||||||
import static org.mockito.Matchers.any;
|
|
||||||
import static org.mockito.Matchers.anyBoolean;
|
|
||||||
import static org.mockito.Matchers.anyInt;
|
|
||||||
import static org.mockito.Matchers.eq;
|
|
||||||
import static org.mockito.Mockito.doAnswer;
|
|
||||||
import static org.mockito.Mockito.doNothing;
|
|
||||||
import static org.mockito.Mockito.doReturn;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.never;
|
|
||||||
import static org.mockito.Mockito.times;
|
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
import android.app.IUserSwitchObserver;
|
import android.app.IUserSwitchObserver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.IIntentReceiver;
|
import android.content.IIntentReceiver;
|
||||||
@@ -72,11 +48,30 @@ import java.util.LinkedHashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||||
|
import static android.testing.DexmakerShareClassLoaderRule.runWithDexmakerShareClassLoader;
|
||||||
|
import static com.android.server.am.UserController.CONTINUE_USER_SWITCH_MSG;
|
||||||
|
import static com.android.server.am.UserController.REPORT_LOCKED_BOOT_COMPLETE_MSG;
|
||||||
|
import static com.android.server.am.UserController.REPORT_USER_SWITCH_COMPLETE_MSG;
|
||||||
|
import static com.android.server.am.UserController.REPORT_USER_SWITCH_MSG;
|
||||||
|
import static com.android.server.am.UserController.SYSTEM_USER_CURRENT_MSG;
|
||||||
|
import static com.android.server.am.UserController.SYSTEM_USER_START_MSG;
|
||||||
|
import static com.android.server.am.UserController.USER_SWITCH_TIMEOUT_MSG;
|
||||||
|
import static org.mockito.ArgumentMatchers.anyString;
|
||||||
|
import static org.mockito.Matchers.any;
|
||||||
|
import static org.mockito.Matchers.anyBoolean;
|
||||||
|
import static org.mockito.Matchers.anyInt;
|
||||||
|
import static org.mockito.Matchers.eq;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.doNothing;
|
||||||
|
import static org.mockito.Mockito.doReturn;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.never;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link UserController}.
|
* Usage: bit FrameworksServicesTests:com.android.server.am.UserControllerTest
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:UserControllerTest
|
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
@Presubmit
|
||||||
public class UserControllerTest extends AndroidTestCase {
|
public class UserControllerTest extends AndroidTestCase {
|
||||||
@@ -18,10 +18,13 @@ package com.android.server.wm;
|
|||||||
|
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||||
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||||
import static junit.framework.Assert.assertFalse;
|
import static junit.framework.Assert.assertFalse;
|
||||||
import static junit.framework.Assert.assertTrue;
|
import static junit.framework.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.verifyZeroInteractions;
|
import static org.mockito.Mockito.verifyZeroInteractions;
|
||||||
|
|
||||||
@@ -30,9 +33,12 @@ import android.support.test.filters.FlakyTest;
|
|||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
@@ -40,7 +46,7 @@ import org.mockito.MockitoAnnotations;
|
|||||||
* Tests for the {@link TaskStack} class.
|
* Tests for the {@link TaskStack} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:AnimatingAppWindowTokenRegistryTest
|
* atest FrameworksServicesTests:com.android.server.wm.AnimatingAppWindowTokenRegistryTest
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -20,7 +20,6 @@ import static android.view.WindowManager.TRANSIT_ACTIVITY_OPEN;
|
|||||||
import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
|
import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
|
||||||
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
|
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
|
||||||
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
|
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -37,8 +36,7 @@ import org.junit.runner.RunWith;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link AppTransition}.
|
* Test class for {@link AppTransition}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest AppTransitionTests
|
||||||
* atest WmTests:AppTransitionTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,32 +16,30 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import android.support.test.filters.FlakyTest;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.InstrumentationRegistry;
|
||||||
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||||
import static android.content.res.Configuration.EMPTY;
|
import static android.content.res.Configuration.EMPTY;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
|
||||||
import android.support.test.InstrumentationRegistry;
|
|
||||||
import android.support.test.filters.FlakyTest;
|
|
||||||
import android.support.test.filters.SmallTest;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import com.android.server.wm.WindowTestUtils.TestTaskWindowContainerController;
|
import com.android.server.wm.WindowTestUtils.TestTaskWindowContainerController;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link AppWindowContainerController}.
|
* Test class for {@link AppWindowContainerController}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest FrameworksServicesTests:com.android.server.wm.AppWindowContainerControllerTests
|
||||||
* atest WmTests:AppWindowContainerControllerTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,6 +16,16 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.filters.FlakyTest;
|
||||||
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
import android.view.Surface;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
||||||
@@ -28,27 +38,15 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
|||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||||
import static android.view.WindowManager.TRANSIT_UNSET;
|
import static android.view.WindowManager.TRANSIT_UNSET;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
|
||||||
import android.support.test.filters.FlakyTest;
|
|
||||||
import android.support.test.filters.SmallTest;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.view.Surface;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link AppWindowToken} class.
|
* Tests for the {@link AppWindowToken} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:AppWindowTokenTests
|
* atest FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
// TODO: b/68267650
|
// TODO: b/68267650
|
||||||
@@ -21,12 +21,6 @@ import static com.android.server.wm.BoundsAnimationController.SCHEDULE_PIP_MODE_
|
|||||||
import static com.android.server.wm.BoundsAnimationController.SCHEDULE_PIP_MODE_CHANGED_ON_START;
|
import static com.android.server.wm.BoundsAnimationController.SCHEDULE_PIP_MODE_CHANGED_ON_START;
|
||||||
import static com.android.server.wm.BoundsAnimationController.SchedulePipModeChangedState;
|
import static com.android.server.wm.BoundsAnimationController.SchedulePipModeChangedState;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotEquals;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertSame;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
@@ -38,12 +32,23 @@ import android.support.test.annotation.UiThreadTest;
|
|||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import com.android.server.wm.BoundsAnimationController.BoundsAnimator;
|
|
||||||
import com.android.server.wm.WindowManagerInternal.AppTransitionListener;
|
import com.android.server.wm.WindowManagerInternal.AppTransitionListener;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertNotSame;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertSame;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
|
import com.android.server.wm.BoundsAnimationController.BoundsAnimator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link BoundsAnimationController} to ensure that it sends the right callbacks
|
* Test class for {@link BoundsAnimationController} to ensure that it sends the right callbacks
|
||||||
* depending on the various interactions.
|
* depending on the various interactions.
|
||||||
@@ -55,7 +60,7 @@ import org.junit.runner.RunWith;
|
|||||||
* appropriately.
|
* appropriately.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* bit WmTests:BoundsAnimationControllerTests
|
* bit FrameworksServicesTests:com.android.server.wm.BoundsAnimationControllerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||||
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||||
@@ -27,7 +28,6 @@ import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
|||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
|
||||||
import static android.content.res.Configuration.EMPTY;
|
import static android.content.res.Configuration.EMPTY;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
@@ -35,7 +35,6 @@ import android.content.res.Configuration;
|
|||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@@ -46,7 +45,7 @@ import java.util.List;
|
|||||||
* Test class for {@link ConfigurationContainer}.
|
* Test class for {@link ConfigurationContainer}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ConfigurationContainerTests
|
* bit FrameworksServicesTests:com.android.server.wm.ConfigurationContainerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -38,10 +38,8 @@ import org.junit.Test;
|
|||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link Dimmer}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:DimmerTests;
|
* atest FrameworksServicesTests:com.android.server.wm.DimmerTests;
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -28,7 +28,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_
|
|||||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
|
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
|
import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
|
||||||
|
|
||||||
import static com.android.server.wm.WindowContainer.POSITION_TOP;
|
import static com.android.server.wm.WindowContainer.POSITION_TOP;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
@@ -39,6 +38,9 @@ import static org.junit.Assert.assertTrue;
|
|||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
@@ -55,9 +57,6 @@ import android.view.Surface;
|
|||||||
|
|
||||||
import com.android.server.wm.utils.WmDisplayCutout;
|
import com.android.server.wm.utils.WmDisplayCutout;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -68,7 +67,7 @@ import java.util.List;
|
|||||||
* Tests for the {@link DisplayContent} class.
|
* Tests for the {@link DisplayContent} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:DisplayContentTests
|
* atest com.android.server.wm.DisplayContentTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -19,7 +19,6 @@ package com.android.server.wm;
|
|||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.any;
|
import static org.mockito.Mockito.any;
|
||||||
@@ -40,23 +39,19 @@ import android.view.InputChannel;
|
|||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
import android.view.SurfaceSession;
|
import android.view.SurfaceSession;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.android.internal.annotations.GuardedBy;
|
import com.android.internal.annotations.GuardedBy;
|
||||||
import com.android.server.LocalServices;
|
import com.android.server.LocalServices;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link DragDropController} class.
|
* Tests for the {@link DragDropController} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest com.android.server.wm.DragDropControllerTests
|
||||||
* atest WmTests:DragDropControllerTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -2,15 +2,6 @@ package com.android.server.wm;
|
|||||||
|
|
||||||
import static android.view.Display.DEFAULT_DISPLAY;
|
import static android.view.Display.DEFAULT_DISPLAY;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
|
||||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
|
||||||
import static org.mockito.Mockito.never;
|
|
||||||
import static org.mockito.Mockito.reset;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
@@ -23,12 +14,15 @@ import org.junit.runner.RunWith;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
/**
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
* Tests for {@link PinnedStackController}.
|
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||||
*
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
* Build/Install/Run:
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
* atest WmTests:PinnedStackControllerTest
|
import static org.mockito.Mockito.never;
|
||||||
*/
|
import static org.mockito.Mockito.reset;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -19,10 +19,8 @@ package com.android.server.wm;
|
|||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
import static android.view.Display.DEFAULT_DISPLAY;
|
import static android.view.Display.DEFAULT_DISPLAY;
|
||||||
|
|
||||||
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
|
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
|
||||||
import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_ORIGINAL_POSITION;
|
import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_ORIGINAL_POSITION;
|
||||||
|
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
import static org.mockito.Mockito.atLeast;
|
import static org.mockito.Mockito.atLeast;
|
||||||
@@ -37,9 +35,7 @@ import android.support.test.filters.SmallTest;
|
|||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.view.IRecentsAnimationRunner;
|
import android.view.IRecentsAnimationRunner;
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
|
|
||||||
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
|
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -47,10 +43,7 @@ import org.mockito.Mock;
|
|||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link RecentsAnimationController}.
|
* atest FrameworksServicesTests:com.android.server.wm.RecentsAnimationControllerTest
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:RecentsAnimationControllerTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -31,6 +31,7 @@ import android.graphics.Rect;
|
|||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.IInterface;
|
import android.os.IInterface;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.filters.FlakyTest;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.view.IRemoteAnimationFinishedCallback;
|
import android.view.IRemoteAnimationFinishedCallback;
|
||||||
@@ -52,10 +53,7 @@ import org.mockito.Mock;
|
|||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link RemoteAnimationController}.
|
* atest FrameworksServicesTests:com.android.server.wm.RemoteAnimationControllerTest
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:RemoteAnimationControllerTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static org.junit.Assert.assertTrue;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link RootWindowContainer} class.
|
* Tests for the {@link RootWindowContainer} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:RootWindowContainerTests
|
* atest FrameworksServicesTests:com.android.server.wm.RootWindowContainerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -32,7 +32,6 @@ import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
|
|||||||
import static android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
|
import static android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
|
||||||
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_IS_SCREEN_DECOR;
|
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_IS_SCREEN_DECOR;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
@@ -71,7 +70,7 @@ import java.util.function.BooleanSupplier;
|
|||||||
* Tests for the {@link android.view.WindowManager.LayoutParams#PRIVATE_FLAG_IS_SCREEN_DECOR} flag.
|
* Tests for the {@link android.view.WindowManager.LayoutParams#PRIVATE_FLAG_IS_SCREEN_DECOR} flag.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ScreenDecorWindowTests
|
* atest FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
|
||||||
*/
|
*/
|
||||||
// TODO: Add test for FLAG_FULLSCREEN which hides the status bar and also other flags.
|
// TODO: Add test for FLAG_FULLSCREEN which hides the status bar and also other flags.
|
||||||
// TODO: Test non-Activity windows.
|
// TODO: Test non-Activity windows.
|
||||||
@@ -16,24 +16,25 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
|
||||||
import android.support.test.filters.SmallTest;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link StackWindowController}.
|
* Test class for {@link StackWindowController}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:StackWindowControllerTests
|
* atest FrameworksServicesTests:StackWindowControllerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
@@ -23,11 +24,11 @@ import static org.mockito.Mockito.any;
|
|||||||
import static org.mockito.Mockito.atLeast;
|
import static org.mockito.Mockito.atLeast;
|
||||||
import static org.mockito.Mockito.atLeastOnce;
|
import static org.mockito.Mockito.atLeastOnce;
|
||||||
import static org.mockito.Mockito.eq;
|
import static org.mockito.Mockito.eq;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
import android.animation.AnimationHandler;
|
||||||
|
|
||||||
import android.animation.AnimationHandler.AnimationFrameCallbackProvider;
|
import android.animation.AnimationHandler.AnimationFrameCallbackProvider;
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
@@ -36,6 +37,7 @@ import android.platform.test.annotations.Presubmit;
|
|||||||
import android.support.test.filters.FlakyTest;
|
import android.support.test.filters.FlakyTest;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Choreographer;
|
import android.view.Choreographer;
|
||||||
import android.view.Choreographer.FrameCallback;
|
import android.view.Choreographer.FrameCallback;
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
@@ -44,6 +46,7 @@ import android.view.animation.Animation;
|
|||||||
import android.view.animation.TranslateAnimation;
|
import android.view.animation.TranslateAnimation;
|
||||||
|
|
||||||
import com.android.server.wm.LocalAnimationAdapter.AnimationSpec;
|
import com.android.server.wm.LocalAnimationAdapter.AnimationSpec;
|
||||||
|
import com.android.server.wm.SurfaceAnimationRunner.AnimatorFactory;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
@@ -58,8 +61,7 @@ import java.util.concurrent.CountDownLatch;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link SurfaceAnimationRunner}.
|
* Test class for {@link SurfaceAnimationRunner}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest FrameworksServicesTests:com.android.server.wm.SurfaceAnimationRunnerTest
|
||||||
* atest WmTests:SurfaceAnimationRunnerTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -46,11 +46,12 @@ import org.mockito.ArgumentCaptor;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link SurfaceAnimatorTest}.
|
* Test class for {@link SurfaceAnimatorTest}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest FrameworksServicesTests:com.android.server.wm.SurfaceAnimatorTest
|
||||||
* atest WmTests:SurfaceAnimatorTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,14 +16,10 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static com.android.server.wm.TaskPositioner.MIN_ASPECT;
|
import org.junit.Before;
|
||||||
import static com.android.server.wm.WindowManagerService.dipToPixel;
|
import org.junit.Ignore;
|
||||||
import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_HEIGHT_IN_DP;
|
import org.junit.Test;
|
||||||
import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_WIDTH_IN_DP;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
@@ -32,16 +28,18 @@ import android.util.DisplayMetrics;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
|
|
||||||
import org.junit.Before;
|
import static com.android.server.wm.TaskPositioner.MIN_ASPECT;
|
||||||
import org.junit.Ignore;
|
import static com.android.server.wm.WindowManagerService.dipToPixel;
|
||||||
import org.junit.Test;
|
import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_HEIGHT_IN_DP;
|
||||||
import org.junit.runner.RunWith;
|
import static com.android.server.wm.WindowState.MINIMUM_VISIBLE_WIDTH_IN_DP;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link TaskPositioner} class.
|
* Tests for the {@link TaskPositioner} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* runtest frameworks-services -c com.android.server.wm.TaskPositionerTests
|
||||||
* atest WmTests:TaskPositionerTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||||
|
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
@@ -31,7 +30,6 @@ import android.platform.test.annotations.Presubmit;
|
|||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.view.InputChannel;
|
import android.view.InputChannel;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -39,8 +37,7 @@ import org.junit.runner.RunWith;
|
|||||||
/**
|
/**
|
||||||
* Tests for the {@link TaskPositioningController} class.
|
* Tests for the {@link TaskPositioningController} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest com.android.server.wm.TaskPositioningControllerTests
|
||||||
* atest WmTests:TaskPositioningControllerTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertNotNull;
|
import static junit.framework.Assert.assertNotNull;
|
||||||
import static junit.framework.Assert.assertNull;
|
import static junit.framework.Assert.assertNull;
|
||||||
|
|
||||||
@@ -32,8 +31,7 @@ import org.junit.runner.RunWith;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link TaskSnapshotCache}.
|
* Test class for {@link TaskSnapshotCache}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* runtest frameworks-services -c com.android.server.wm.TaskSnapshotCacheTest
|
||||||
* atest WmTests:TaskSnapshotCacheTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -19,11 +19,10 @@ package com.android.server.wm;
|
|||||||
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||||
import static android.view.WindowManager.TRANSIT_UNSET;
|
import static android.view.WindowManager.TRANSIT_UNSET;
|
||||||
|
import static com.android.server.wm.TaskSnapshotController.*;
|
||||||
import static com.android.server.wm.TaskSnapshotController.SNAPSHOT_MODE_APP_THEME;
|
|
||||||
import static com.android.server.wm.TaskSnapshotController.SNAPSHOT_MODE_REAL;
|
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
import static junit.framework.Assert.assertFalse;
|
||||||
|
import static junit.framework.Assert.assertTrue;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
@@ -31,15 +30,13 @@ import android.support.test.runner.AndroidJUnit4;
|
|||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
|
|
||||||
import com.google.android.collect.Sets;
|
import com.google.android.collect.Sets;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link TaskSnapshotController}.
|
* Test class for {@link TaskSnapshotController}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* runtest frameworks-services -c com.android.server.wm.TaskSnapshotControllerTest
|
||||||
* atest WmTests:TaskSnapshotControllerTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -18,12 +18,12 @@ package com.android.server.wm;
|
|||||||
|
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import android.app.ActivityManager.TaskSnapshot;
|
import android.app.ActivityManager.TaskSnapshot;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
@@ -33,8 +33,8 @@ import android.platform.test.annotations.Presubmit;
|
|||||||
import android.support.test.filters.MediumTest;
|
import android.support.test.filters.MediumTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
import com.android.server.wm.TaskSnapshotPersister.RemoveObsoleteFilesQueueItem;
|
import com.android.server.wm.TaskSnapshotPersister.RemoveObsoleteFilesQueueItem;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -45,8 +45,7 @@ import java.io.File;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link TaskSnapshotPersister} and {@link TaskSnapshotLoader}
|
* Test class for {@link TaskSnapshotPersister} and {@link TaskSnapshotLoader}
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest FrameworksServicesTests:TaskSnapshotPersisterLoaderTest
|
||||||
* atest WmTests:TaskSnapshotPersisterLoaderTest
|
|
||||||
*/
|
*/
|
||||||
@MediumTest
|
@MediumTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -19,7 +19,6 @@ package com.android.server.wm;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||||
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
|
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Matchers.anyInt;
|
import static org.mockito.Matchers.anyInt;
|
||||||
@@ -48,8 +47,7 @@ import org.junit.runner.RunWith;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link TaskSnapshotSurface}.
|
* Test class for {@link TaskSnapshotSurface}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* runtest frameworks-services -c com.android.server.wm.TaskSnapshotSurfaceTest
|
||||||
* atest WmTests:TaskSnapshotSurfaceTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -18,25 +18,26 @@ package com.android.server.wm;
|
|||||||
|
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.After;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link DisplayContent.TaskStackContainers} container in {@link DisplayContent}.
|
* Tests for the {@link DisplayContent.TaskStackContainers} container in {@link DisplayContent}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:TaskStackContainersTests
|
* bit FrameworksServicesTests:com.android.server.wm.TaskStackContainersTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,24 +16,27 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
import org.junit.Test;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||||
import org.junit.runner.RunWith;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link TaskStack} class.
|
* Tests for the {@link TaskStack} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:TaskStackTests
|
* bit FrameworksServicesTests:com.android.server.wm.TaskStackTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,23 +16,22 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
|
||||||
import android.support.test.filters.SmallTest;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link TaskWindowContainerController}.
|
* Test class for {@link TaskWindowContainerController}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:TaskWindowContainerControllerTests
|
* bit FrameworksServicesTests:com.android.server.wm.TaskWindowContainerControllerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import com.android.internal.os.IResultReceiver;
|
||||||
|
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
@@ -25,8 +27,6 @@ import android.view.DisplayCutout;
|
|||||||
import android.view.DragEvent;
|
import android.view.DragEvent;
|
||||||
import android.view.IWindow;
|
import android.view.IWindow;
|
||||||
|
|
||||||
import com.android.internal.os.IResultReceiver;
|
|
||||||
|
|
||||||
public class TestIWindow extends IWindow.Stub {
|
public class TestIWindow extends IWindow.Stub {
|
||||||
@Override
|
@Override
|
||||||
public void executeCommand(String command, String parameters,
|
public void executeCommand(String command, String parameters,
|
||||||
@@ -29,8 +29,7 @@ import org.junit.runner.RunWith;
|
|||||||
/**
|
/**
|
||||||
* Test class for {@link AppTransition}.
|
* Test class for {@link AppTransition}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* runtest frameworks-services -c com.android.server.wm.UnknownAppVisibilityControllerTest
|
||||||
* atest WmTests:UnknownAppVisibilityControllerTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -40,8 +40,7 @@ import org.junit.runner.RunWith;
|
|||||||
/**
|
/**
|
||||||
* Tests for the {@link WindowAnimationSpec} class.
|
* Tests for the {@link WindowAnimationSpec} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest FrameworksServicesTests:com.android.server.wm.WindowAnimationSpecTest
|
||||||
* atest WmTests:WindowAnimationSpecTest
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,16 +16,7 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
import org.junit.Test;
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
|
||||||
import static android.app.WindowConfiguration.WINDOW_CONFIG_APP_BOUNDS;
|
|
||||||
import static android.app.WindowConfiguration.WINDOW_CONFIG_WINDOWING_MODE;
|
|
||||||
import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotEquals;
|
|
||||||
|
|
||||||
import android.app.WindowConfiguration;
|
import android.app.WindowConfiguration;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
@@ -36,13 +27,22 @@ import android.support.test.filters.SmallTest;
|
|||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.view.DisplayInfo;
|
import android.view.DisplayInfo;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||||
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||||
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
|
import static android.app.WindowConfiguration.WINDOW_CONFIG_APP_BOUNDS;
|
||||||
|
import static android.app.WindowConfiguration.WINDOW_CONFIG_WINDOWING_MODE;
|
||||||
|
import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class to for {@link android.app.WindowConfiguration}.
|
* Test class to for {@link android.app.WindowConfiguration}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:WindowConfigurationTests
|
* bit FrameworksServicesTests:com.android.server.wm.WindowConfigurationTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@FlakyTest(bugId = 74078662)
|
@FlakyTest(bugId = 74078662)
|
||||||
@@ -16,26 +16,26 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
import android.app.WindowConfiguration;
|
||||||
import static android.content.res.Configuration.EMPTY;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.platform.test.annotations.Presubmit;
|
|
||||||
import android.support.test.filters.FlakyTest;
|
import android.support.test.filters.FlakyTest;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||||
|
import static android.content.res.Configuration.EMPTY;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link WindowContainerController}.
|
* Test class for {@link WindowContainerController}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:WindowContainerControllerTests
|
* bit FrameworksServicesTests:com.android.server.wm.WindowContainerControllerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,6 +16,20 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import android.support.test.filters.FlakyTest;
|
||||||
|
import android.view.SurfaceControl;
|
||||||
|
import android.view.SurfaceSession;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
|
||||||
@@ -30,6 +44,7 @@ import static org.junit.Assert.assertFalse;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import static org.mockito.Mockito.any;
|
import static org.mockito.Mockito.any;
|
||||||
import static org.mockito.Mockito.anyFloat;
|
import static org.mockito.Mockito.anyFloat;
|
||||||
import static org.mockito.Mockito.eq;
|
import static org.mockito.Mockito.eq;
|
||||||
@@ -38,25 +53,11 @@ import static org.mockito.Mockito.never;
|
|||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
|
||||||
import android.support.test.filters.FlakyTest;
|
|
||||||
import android.support.test.filters.SmallTest;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.view.SurfaceControl;
|
|
||||||
import android.view.SurfaceSession;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link WindowContainer}.
|
* Test class for {@link WindowContainer}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:WindowContainerTests
|
* atest FrameworksServicesTests:com.android.server.wm.WindowContainerTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -20,10 +20,9 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||||
|
|
||||||
import static org.mockito.Matchers.eq;
|
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Matchers.eq;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
@@ -32,13 +31,12 @@ import android.support.test.runner.AndroidJUnit4;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import org.mockito.Mock;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link WindowContainer#forAllWindows} and various implementations.
|
* Tests for {@link WindowContainer#forAllWindows} and various implementations.
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:WindowContainerTraversalTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,12 +16,9 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.view.DisplayCutout.fromBoundingRect;
|
import org.junit.Before;
|
||||||
import static android.view.WindowManager.LayoutParams.FILL_PARENT;
|
import org.junit.Test;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import android.app.ActivityManager.TaskDescription;
|
import android.app.ActivityManager.TaskDescription;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
@@ -34,17 +31,18 @@ import android.view.Gravity;
|
|||||||
import android.view.IWindow;
|
import android.view.IWindow;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import com.android.server.wm.utils.WmDisplayCutout;
|
import static android.view.DisplayCutout.fromBoundingRect;
|
||||||
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
||||||
|
import static android.view.WindowManager.LayoutParams.FILL_PARENT;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import org.junit.Before;
|
import com.android.server.wm.utils.WmDisplayCutout;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link WindowState#computeFrameLw} method and other window frame machinery.
|
* Tests for the {@link WindowState#computeFrameLw} method and other window frame machinery.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run: bit FrameworksServicesTests:com.android.server.wm.WindowFrameTests
|
||||||
* atest WmTests:WindowFrameTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -16,6 +16,17 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
import android.support.test.filters.FlakyTest;
|
||||||
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
||||||
@@ -44,22 +55,10 @@ import static org.mockito.Mockito.reset;
|
|||||||
import static org.mockito.Mockito.spy;
|
import static org.mockito.Mockito.spy;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
|
||||||
import android.support.test.filters.FlakyTest;
|
|
||||||
import android.support.test.filters.SmallTest;
|
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.util.LinkedList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link WindowState} class.
|
* Tests for the {@link WindowState} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* atest FrameworksServicesTests:com.android.server.wm.WindowStateTests
|
||||||
* atest WmTests:WindowStateTests
|
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@FlakyTest(bugId = 74078662)
|
@FlakyTest(bugId = 74078662)
|
||||||
@@ -20,7 +20,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
|||||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||||
import static android.view.WindowManager.TRANSIT_TASK_CLOSE;
|
import static android.view.WindowManager.TRANSIT_TASK_CLOSE;
|
||||||
import static android.view.WindowManager.TRANSIT_TASK_OPEN;
|
import static android.view.WindowManager.TRANSIT_TASK_OPEN;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
@@ -32,12 +31,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link WindowSurfacePlacer}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:WindowSurfacePlacerTest
|
|
||||||
*/
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -16,21 +16,8 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.app.AppOpsManager.OP_NONE;
|
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
|
|
||||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
|
||||||
|
|
||||||
import static com.android.server.wm.WindowContainer.POSITION_TOP;
|
|
||||||
|
|
||||||
import static org.mockito.Mockito.any;
|
|
||||||
import static org.mockito.Mockito.anyBoolean;
|
|
||||||
import static org.mockito.Mockito.anyFloat;
|
|
||||||
import static org.mockito.Mockito.anyInt;
|
|
||||||
import static org.mockito.Mockito.doAnswer;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
@@ -39,6 +26,19 @@ import android.view.IApplicationToken;
|
|||||||
import android.view.IWindow;
|
import android.view.IWindow;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import static android.app.AppOpsManager.OP_NONE;
|
||||||
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;
|
||||||
|
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||||
|
|
||||||
|
import static com.android.server.wm.WindowContainer.POSITION_TOP;
|
||||||
|
import static org.mockito.Mockito.any;
|
||||||
|
import static org.mockito.Mockito.anyBoolean;
|
||||||
|
import static org.mockito.Mockito.anyFloat;
|
||||||
|
import static org.mockito.Mockito.anyInt;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,29 +16,29 @@
|
|||||||
|
|
||||||
package com.android.server.wm;
|
package com.android.server.wm;
|
||||||
|
|
||||||
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
import org.junit.Test;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
import org.junit.runner.RunWith;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.FlakyTest;
|
import android.support.test.filters.FlakyTest;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
|
||||||
import org.junit.runner.RunWith;
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
||||||
|
import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link WindowToken} class.
|
* Tests for the {@link WindowToken} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:WindowTokenTests
|
* bit FrameworksServicesTests:com.android.server.wm.WindowTokenTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@FlakyTest(bugId = 74078662)
|
@FlakyTest(bugId = 74078662)
|
||||||
@@ -30,12 +30,13 @@ import static org.mockito.Mockito.verifyZeroInteractions;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.InstrumentationRegistry;
|
import android.support.test.InstrumentationRegistry;
|
||||||
import android.support.test.filters.FlakyTest;
|
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.filters.FlakyTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.util.proto.ProtoOutputStream;
|
import android.util.proto.ProtoOutputStream;
|
||||||
|
|
||||||
import com.android.internal.util.Preconditions;
|
import com.android.internal.util.Preconditions;
|
||||||
|
import com.android.server.wm.WindowManagerTraceProto;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -53,7 +54,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
* Test class for {@link WindowTracing}.
|
* Test class for {@link WindowTracing}.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:WindowTracingTest
|
* bit FrameworksServicesTests:com.android.server.wm.WindowTracingTest
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@FlakyTest(bugId = 74078662)
|
@FlakyTest(bugId = 74078662)
|
||||||
@@ -27,14 +27,15 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_
|
|||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
|
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
|
||||||
|
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
|
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL;
|
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL;
|
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL;
|
||||||
import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
|
import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.FlakyTest;
|
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
|
import android.support.test.filters.FlakyTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
import android.view.SurfaceSession;
|
import android.view.SurfaceSession;
|
||||||
@@ -50,7 +51,7 @@ import java.util.LinkedList;
|
|||||||
* Tests for the {@link WindowLayersController} class.
|
* Tests for the {@link WindowLayersController} class.
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Build/Install/Run:
|
||||||
* atest WmTests:ZOrderingTests
|
* bit FrameworksServicesTests:com.android.server.wm.ZOrderingTests
|
||||||
*/
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@FlakyTest(bugId = 74078662)
|
@FlakyTest(bugId = 74078662)
|
||||||
@@ -21,11 +21,10 @@ import static android.view.Surface.ROTATION_180;
|
|||||||
import static android.view.Surface.ROTATION_270;
|
import static android.view.Surface.ROTATION_270;
|
||||||
import static android.view.Surface.ROTATION_90;
|
import static android.view.Surface.ROTATION_90;
|
||||||
|
|
||||||
import static com.android.server.wm.utils.CoordinateTransforms
|
import static com.android.server.wm.utils.CoordinateTransforms.transformPhysicalToLogicalCoordinates;
|
||||||
.transformPhysicalToLogicalCoordinates;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
@@ -36,12 +35,6 @@ import org.junit.Rule;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ErrorCollector;
|
import org.junit.rules.ErrorCollector;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link CoordinateTransforms}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:CoordinateTransformsTest
|
|
||||||
*/
|
|
||||||
public class CoordinateTransformsTest {
|
public class CoordinateTransformsTest {
|
||||||
|
|
||||||
private static final int W = 200;
|
private static final int W = 200;
|
||||||
@@ -102,4 +95,4 @@ public class CoordinateTransformsTest {
|
|||||||
public interface DevicePointAssertable {
|
public interface DevicePointAssertable {
|
||||||
void mapsToLogicalPoint(int x, int y);
|
void mapsToLogicalPoint(int x, int y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,16 +22,11 @@ import android.graphics.Rect;
|
|||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.support.test.filters.SmallTest;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
import android.util.Pair;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link InsetUtils}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:InsetUtilsTest
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@@ -29,16 +29,13 @@ import android.support.test.filters.SmallTest;
|
|||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
|
|
||||||
|
import com.android.server.wm.utils.RotationCache.RotationDependentComputation;
|
||||||
|
|
||||||
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests for {@link RotationCache}.
|
|
||||||
*
|
|
||||||
* Build/Install/Run:
|
|
||||||
* atest WmTests:RotationCacheTest
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@FlakyTest(bugId = 74078662)
|
@FlakyTest(bugId = 74078662)
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.server.wm.utils;
|
package com.android.server.wm.utils;
|
||||||
|
|
||||||
|
|
||||||
import static android.view.DisplayCutout.NO_CUTOUT;
|
import static android.view.DisplayCutout.NO_CUTOUT;
|
||||||
import static android.view.DisplayCutout.fromBoundingRect;
|
import static android.view.DisplayCutout.fromBoundingRect;
|
||||||
|
|
||||||
@@ -37,8 +38,7 @@ import java.util.Arrays;
|
|||||||
/**
|
/**
|
||||||
* Tests for {@link WmDisplayCutout}
|
* Tests for {@link WmDisplayCutout}
|
||||||
*
|
*
|
||||||
* Build/Install/Run:
|
* Run with: atest WmDisplayCutoutTest
|
||||||
* atest WmTests:WmDisplayCutoutTest
|
|
||||||
*/
|
*/
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@@ -14,14 +14,9 @@ LOCAL_SRC_FILES := \
|
|||||||
$(call all-java-files-under, ../servicestests/utils)
|
$(call all-java-files-under, ../servicestests/utils)
|
||||||
|
|
||||||
LOCAL_STATIC_JAVA_LIBRARIES := \
|
LOCAL_STATIC_JAVA_LIBRARIES := \
|
||||||
frameworks-base-testutils \
|
androidx-test \
|
||||||
services.core \
|
|
||||||
android-support-test \
|
|
||||||
mockito-target-minus-junit4 \
|
mockito-target-minus-junit4 \
|
||||||
platform-test-annotations \
|
platform-test-annotations \
|
||||||
truth-prebuilt \
|
|
||||||
testables \
|
|
||||||
ub-uiautomator \
|
|
||||||
|
|
||||||
LOCAL_JAVA_LIBRARIES := \
|
LOCAL_JAVA_LIBRARIES := \
|
||||||
android.test.mock \
|
android.test.mock \
|
||||||
|
|||||||
@@ -22,30 +22,10 @@
|
|||||||
android:minSdkVersion="1"
|
android:minSdkVersion="1"
|
||||||
android:targetSdkVersion="28" />
|
android:targetSdkVersion="28" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
|
<application android:testOnly="true" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
||||||
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
|
|
||||||
<uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" />
|
|
||||||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
|
||||||
<uses-permission android:name="android.permission.STATUS_BAR_SERVICE" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
|
|
||||||
<uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
|
|
||||||
<uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" />
|
|
||||||
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
|
||||||
<uses-permission android:name="android.permission.MANAGE_USERS" />
|
|
||||||
|
|
||||||
<application android:testOnly="true">
|
|
||||||
<activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" />
|
|
||||||
<activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityB" />
|
|
||||||
<activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityRequestedOrientationChange" />
|
|
||||||
<activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskChangeCallbacks" />
|
|
||||||
<activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskDescriptionChange" />
|
|
||||||
<activity android:name="com.android.server.wm.ScreenDecorWindowTests$TestActivity" />
|
|
||||||
</application>
|
|
||||||
|
|
||||||
<instrumentation
|
<instrumentation
|
||||||
android:name="android.support.test.runner.AndroidJUnitRunner"
|
android:name="androidx.test.runner.AndroidJUnitRunner"
|
||||||
android:label="Window Manager Tests"
|
android:label="Window Manager Tests"
|
||||||
android:targetPackage="com.android.frameworks.wmtests" />
|
android:targetPackage="com.android.frameworks.wmtests" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
</target_preparer>
|
</target_preparer>
|
||||||
|
|
||||||
<option name="test-tag" value="WmTests" />
|
<option name="test-tag" value="WmTests" />
|
||||||
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
|
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
|
||||||
<option name="package" value="com.android.frameworks.wmtests" />
|
<option name="package" value="com.android.frameworks.wmtests" />
|
||||||
<option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
|
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
|
||||||
<option name="hidden-api-checks" value="false"/>
|
<option name="hidden-api-checks" value="false" />
|
||||||
</test>
|
</test>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* 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.am;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import androidx.test.filters.FlakyTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dummy test for com.android.server.am.
|
||||||
|
* TODO(b/113800711): Remove this class once the actual tests are moved from servicestests.
|
||||||
|
*/
|
||||||
|
public class DummyAmTests {
|
||||||
|
|
||||||
|
@Presubmit
|
||||||
|
@Test
|
||||||
|
public void preSubmitTest() {}
|
||||||
|
|
||||||
|
@FlakyTest
|
||||||
|
@Presubmit
|
||||||
|
@Test
|
||||||
|
public void flakyPreSubmitTest() {}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void postSubmitTest() {}
|
||||||
|
|
||||||
|
@FlakyTest
|
||||||
|
@Test
|
||||||
|
public void flakyPostSubmitTest() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* 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.wm;
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Presubmit;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import androidx.test.filters.FlakyTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dummy test for com.android.server.wm
|
||||||
|
* TODO(b/113800711): Remove this class once the actual tests are moved from servicestests.
|
||||||
|
*/
|
||||||
|
public class DummyWmTests {
|
||||||
|
|
||||||
|
@Presubmit
|
||||||
|
@Test
|
||||||
|
public void preSubmitTest() {}
|
||||||
|
|
||||||
|
@FlakyTest
|
||||||
|
@Presubmit
|
||||||
|
@Test
|
||||||
|
public void flakyPreSubmitTest() {}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void postSubmitTest() {}
|
||||||
|
|
||||||
|
@FlakyTest
|
||||||
|
@Test
|
||||||
|
public void flakyPostSubmitTest() {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user