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