Merge "Minor clean up." into rvc-dev am: f0298c4672 am: 6ea0045233 am: 75cc120285
Change-Id: I9023a8032b65aad290e4b2fa081a13482ebff85a
This commit is contained in:
@@ -24,13 +24,18 @@ import android.app.ActivityThread;
|
|||||||
import android.hardware.display.DisplayManager;
|
import android.hardware.display.DisplayManager;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import androidx.test.filters.SmallTest;
|
import androidx.test.filters.SmallTest;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Build/Install/Run:
|
||||||
|
* atest FrameworksCoreTests:ContextTest
|
||||||
|
*/
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class ContextTest {
|
public class ContextTest {
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ import android.view.WindowManager.LayoutParams;
|
|||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import androidx.test.filters.FlakyTest;
|
import androidx.test.filters.FlakyTest;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -45,12 +45,18 @@ import org.junit.runner.RunWith;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test {@link InsetsSourceConsumer} with IME type.
|
||||||
|
*
|
||||||
|
* Build/Install/Run:
|
||||||
|
* atest FrameworksCoreTests:ImeInsetsSourceConsumerTest
|
||||||
|
*/
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@FlakyTest(detail = "Promote once confirmed non-flaky")
|
@FlakyTest(detail = "Promote once confirmed non-flaky")
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class ImeInsetsSourceConsumerTest {
|
public class ImeInsetsSourceConsumerTest {
|
||||||
|
|
||||||
Context mContext = InstrumentationRegistry.getTargetContext();
|
Context mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
ImeInsetsSourceConsumer mImeConsumer;
|
ImeInsetsSourceConsumer mImeConsumer;
|
||||||
InsetsController mController;
|
InsetsController mController;
|
||||||
SurfaceControl mLeash;
|
SurfaceControl mLeash;
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ import android.view.animation.LinearInterpolator;
|
|||||||
import android.view.test.InsetsModeSession;
|
import android.view.test.InsetsModeSession;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
|
||||||
import com.android.server.testutils.OffsettableClock;
|
import com.android.server.testutils.OffsettableClock;
|
||||||
import com.android.server.testutils.TestHandler;
|
import com.android.server.testutils.TestHandler;
|
||||||
@@ -113,7 +113,7 @@ public class InsetsControllerTest {
|
|||||||
.setName("testSurface")
|
.setName("testSurface")
|
||||||
.build();
|
.build();
|
||||||
InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
|
InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
|
||||||
Context context = InstrumentationRegistry.getTargetContext();
|
Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
// cannot mock ViewRootImpl since it's final.
|
// cannot mock ViewRootImpl since it's final.
|
||||||
mViewRoot = new ViewRootImpl(context, context.getDisplayNoVerify());
|
mViewRoot = new ViewRootImpl(context, context.getDisplayNoVerify());
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
package android.view;
|
package android.view;
|
||||||
|
|
||||||
import static android.view.InsetsState.ITYPE_STATUS_BAR;
|
import static android.view.InsetsState.ITYPE_STATUS_BAR;
|
||||||
|
|
||||||
import static android.view.WindowInsets.Type.statusBars;
|
import static android.view.WindowInsets.Type.statusBars;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
import static junit.framework.Assert.assertEquals;
|
||||||
import static junit.framework.TestCase.assertFalse;
|
import static junit.framework.TestCase.assertFalse;
|
||||||
import static junit.framework.TestCase.assertTrue;
|
import static junit.framework.TestCase.assertTrue;
|
||||||
@@ -37,8 +37,8 @@ import android.view.WindowManager.BadTokenException;
|
|||||||
import android.view.WindowManager.LayoutParams;
|
import android.view.WindowManager.LayoutParams;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ import android.platform.test.annotations.Presubmit;
|
|||||||
import android.view.WindowInsets.Side;
|
import android.view.WindowInsets.Side;
|
||||||
import android.view.WindowInsets.Type;
|
import android.view.WindowInsets.Type;
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import androidx.test.filters.SmallTest;
|
import androidx.test.filters.SmallTest;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -51,6 +51,12 @@ import org.junit.runner.RunWith;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link ViewRootImpl}
|
||||||
|
*
|
||||||
|
* Build/Install/Run:
|
||||||
|
* atest FrameworksCoreTests:ViewRootImplTest
|
||||||
|
*/
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@@ -61,7 +67,7 @@ public class ViewRootImplTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
mContext = InstrumentationRegistry.getContext();
|
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
|
|
||||||
InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
|
InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
|
||||||
mViewRootImpl = new ViewRootImplAccessor(
|
mViewRootImpl = new ViewRootImplAccessor(
|
||||||
|
|||||||
Reference in New Issue
Block a user