Merge changes I829278ac,I610858c5
* changes: Add input tests in FrameworksCoreTests to presubmit Use pointer source in MotionEventTest#testEventRotation
This commit is contained in:
committed by
Android (Google) Code Review
commit
5f18344c6b
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user