Merge changes I829278ac,I610858c5

* changes:
  Add input tests in FrameworksCoreTests to presubmit
  Use pointer source in MotionEventTest#testEventRotation
This commit is contained in:
TreeHugger Robot
2021-09-21 10:02:26 +00:00
committed by Android (Google) Code Review
4 changed files with 9 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import android.os.Parcel;
import android.platform.test.annotations.Presubmit;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -34,6 +35,7 @@ import java.util.Set;
@SmallTest
@RunWith(AndroidJUnit4.class)
@Presubmit
public class KeyEventTest {
private static final int DOWN_TIME = 50;

View File

@@ -26,6 +26,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import android.platform.test.annotations.Presubmit;
import android.view.MotionEvent.PointerCoords;
import android.view.MotionEvent.PointerProperties;
@@ -40,6 +41,7 @@ import java.util.Set;
@RunWith(AndroidJUnit4.class)
@SmallTest
@Presubmit
public class MotionEventTest {
private static final int ID_SOURCE_MASK = 0x3 << 30;
@@ -174,6 +176,7 @@ public class MotionEventTest {
public void testEventRotation() {
final MotionEvent event = MotionEvent.obtain(0 /* downTime */, 0 /* eventTime */,
ACTION_DOWN, 30 /* x */, 50 /* y */, 0 /* metaState */);
event.setSource(InputDevice.SOURCE_TOUCHSCREEN);
MotionEvent rot90 = MotionEvent.obtain(event);
rot90.transform(MotionEvent.createRotateMatrix(/* 90 deg */1, 1000, 600));
assertEquals(50, (int) rot90.getX());

View File

@@ -19,6 +19,7 @@ package android.view
import android.view.InputDevice.SOURCE_KEYBOARD
import android.view.KeyEvent.ACTION_DOWN
import android.os.Parcel
import android.platform.test.annotations.Presubmit
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
@@ -30,6 +31,7 @@ import org.junit.Test
@RunWith(AndroidJUnit4::class)
@SmallTest
@Presubmit
class VerifiedKeyEventTest {
@Test

View File

@@ -23,6 +23,7 @@ import android.view.MotionEvent.FLAG_WINDOW_IS_OBSCURED
import android.view.MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED
import android.view.MotionEvent.FLAG_TAINTED
import android.os.Parcel
import android.platform.test.annotations.Presubmit
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
@@ -35,6 +36,7 @@ import org.junit.Test
@RunWith(AndroidJUnit4::class)
@SmallTest
@Presubmit
class VerifiedMotionEventTest {
@Test