Loading packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/DiagonalClassifierTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading @@ -56,18 +57,21 @@ public class DiagonalClassifierTest extends SysuiTestCase { private FalsingClassifier mClassifier; @Before @Ignore("Memory Leak?") public void setup() { MockitoAnnotations.initMocks(this); mClassifier = new DiagonalClassifier(mDataProvider); } @Test @Ignore("Memory Leak?") public void testPass_UnknownAngle() { when(mDataProvider.getAngle()).thenReturn(Float.MAX_VALUE); assertThat(mClassifier.isFalseTouch(), is(false)); } @Test @Ignore("Memory Leak?") public void testPass_VerticalSwipe() { when(mDataProvider.getAngle()).thenReturn(UP_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -77,6 +81,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_MostlyVerticalSwipe() { when(mDataProvider.getAngle()).thenReturn(UP_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -92,6 +97,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_BarelyVerticalSwipe() { when(mDataProvider.getAngle()).thenReturn( UP_IN_RADIANS - FORTY_FIVE_DEG_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS); Loading @@ -111,6 +117,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_HorizontalSwipe() { when(mDataProvider.getAngle()).thenReturn(RIGHT_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -120,6 +127,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_MostlyHorizontalSwipe() { when(mDataProvider.getAngle()).thenReturn(RIGHT_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -135,6 +143,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_BarelyHorizontalSwipe() { when(mDataProvider.getAngle()).thenReturn( RIGHT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS); Loading @@ -154,6 +163,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_AffordanceSwipe() { when(mDataProvider.getInteractionType()).thenReturn(LEFT_AFFORDANCE); when(mDataProvider.getAngle()).thenReturn( Loading @@ -172,6 +182,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_DiagonalSwipe() { // Horizontal Swipes when(mDataProvider.isVertical()).thenReturn(false); Loading packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/DistanceClassifierTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -61,11 +62,13 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_noPointer() { assertThat(mClassifier.isFalseTouch(), is(true)); } @Test @Ignore("Memory Leak?") public void testPass_fling() { MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); MotionEvent motionEventB = MotionEvent.obtain(1, 2, MotionEvent.ACTION_MOVE, 1, 2, 0); Loading @@ -86,6 +89,7 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_flingShort() { MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); MotionEvent motionEventB = MotionEvent.obtain(1, 2, MotionEvent.ACTION_MOVE, 1, 2, 0); Loading @@ -106,6 +110,7 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_flingSlowly() { // These events, in testing, result in a fling that falls just short of the threshold. MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); Loading Loading @@ -136,6 +141,7 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_swipe() { MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); MotionEvent motionEventB = MotionEvent.obtain(1, 3, MotionEvent.ACTION_MOVE, 1, DPI * 3, 0); Loading packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/FalsingDataProviderTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -47,6 +48,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_trackMotionEvents() { MotionEvent motionEventA = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 2, 9); MotionEvent motionEventB = obtainMotionEvent(MotionEvent.ACTION_MOVE, 2, 4, 7); Loading Loading @@ -77,6 +79,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_trackRecentMotionEvents() { MotionEvent motionEventA = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 2, 9); MotionEvent motionEventB = obtainMotionEvent(MotionEvent.ACTION_MOVE, 800, 4, 7); Loading Loading @@ -122,6 +125,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_unpackMotionEvents() { // Batching only works for motion events of the same type. MotionEvent motionEventA = obtainMotionEvent(MotionEvent.ACTION_MOVE, 1, 2, 9); Loading Loading @@ -155,6 +159,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_getAngle() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading Loading @@ -182,6 +187,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isHorizontal() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading @@ -208,6 +214,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isVertical() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading @@ -234,6 +241,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isRight() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading @@ -260,6 +268,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isUp() { // Remember that our y axis is flipped. Loading packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/PointerCountClassifierTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading @@ -47,11 +48,13 @@ public class PointerCountClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_noPointer() { assertThat(mClassifier.isFalseTouch(), is(false)); } @Test @Ignore("Memory Leak?") public void testPass_singlePointer() { MotionEvent motionEvent = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); mClassifier.onTouchEvent(motionEvent); Loading @@ -60,6 +63,7 @@ public class PointerCountClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_multiPointer() { MotionEvent.PointerProperties[] pointerProperties = MotionEvent.PointerProperties.createArray(2); Loading packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/ProximityClassifierTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -64,6 +65,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_uncovered() { touchDown(); touchUp(10); Loading @@ -71,6 +73,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_mostlyUncovered() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading @@ -80,6 +83,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_quickSettings() { touchDown(); when(mDataProvider.getInteractionType()).thenReturn(QUICK_SETTINGS); Loading @@ -90,6 +94,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_covered() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading @@ -99,6 +104,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_mostlyCovered() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading @@ -110,6 +116,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_coveredWithLongSwipe() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading Loading
packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/DiagonalClassifierTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading @@ -56,18 +57,21 @@ public class DiagonalClassifierTest extends SysuiTestCase { private FalsingClassifier mClassifier; @Before @Ignore("Memory Leak?") public void setup() { MockitoAnnotations.initMocks(this); mClassifier = new DiagonalClassifier(mDataProvider); } @Test @Ignore("Memory Leak?") public void testPass_UnknownAngle() { when(mDataProvider.getAngle()).thenReturn(Float.MAX_VALUE); assertThat(mClassifier.isFalseTouch(), is(false)); } @Test @Ignore("Memory Leak?") public void testPass_VerticalSwipe() { when(mDataProvider.getAngle()).thenReturn(UP_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -77,6 +81,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_MostlyVerticalSwipe() { when(mDataProvider.getAngle()).thenReturn(UP_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -92,6 +97,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_BarelyVerticalSwipe() { when(mDataProvider.getAngle()).thenReturn( UP_IN_RADIANS - FORTY_FIVE_DEG_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS); Loading @@ -111,6 +117,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_HorizontalSwipe() { when(mDataProvider.getAngle()).thenReturn(RIGHT_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -120,6 +127,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_MostlyHorizontalSwipe() { when(mDataProvider.getAngle()).thenReturn(RIGHT_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS); assertThat(mClassifier.isFalseTouch(), is(false)); Loading @@ -135,6 +143,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_BarelyHorizontalSwipe() { when(mDataProvider.getAngle()).thenReturn( RIGHT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS); Loading @@ -154,6 +163,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_AffordanceSwipe() { when(mDataProvider.getInteractionType()).thenReturn(LEFT_AFFORDANCE); when(mDataProvider.getAngle()).thenReturn( Loading @@ -172,6 +182,7 @@ public class DiagonalClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_DiagonalSwipe() { // Horizontal Swipes when(mDataProvider.isVertical()).thenReturn(false); Loading
packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/DistanceClassifierTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -61,11 +62,13 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_noPointer() { assertThat(mClassifier.isFalseTouch(), is(true)); } @Test @Ignore("Memory Leak?") public void testPass_fling() { MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); MotionEvent motionEventB = MotionEvent.obtain(1, 2, MotionEvent.ACTION_MOVE, 1, 2, 0); Loading @@ -86,6 +89,7 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_flingShort() { MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); MotionEvent motionEventB = MotionEvent.obtain(1, 2, MotionEvent.ACTION_MOVE, 1, 2, 0); Loading @@ -106,6 +110,7 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_flingSlowly() { // These events, in testing, result in a fling that falls just short of the threshold. MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); Loading Loading @@ -136,6 +141,7 @@ public class DistanceClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_swipe() { MotionEvent motionEventA = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); MotionEvent motionEventB = MotionEvent.obtain(1, 3, MotionEvent.ACTION_MOVE, 1, DPI * 3, 0); Loading
packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/FalsingDataProviderTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -47,6 +48,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_trackMotionEvents() { MotionEvent motionEventA = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 2, 9); MotionEvent motionEventB = obtainMotionEvent(MotionEvent.ACTION_MOVE, 2, 4, 7); Loading Loading @@ -77,6 +79,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_trackRecentMotionEvents() { MotionEvent motionEventA = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 2, 9); MotionEvent motionEventB = obtainMotionEvent(MotionEvent.ACTION_MOVE, 800, 4, 7); Loading Loading @@ -122,6 +125,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_unpackMotionEvents() { // Batching only works for motion events of the same type. MotionEvent motionEventA = obtainMotionEvent(MotionEvent.ACTION_MOVE, 1, 2, 9); Loading Loading @@ -155,6 +159,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_getAngle() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading Loading @@ -182,6 +187,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isHorizontal() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading @@ -208,6 +214,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isVertical() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading @@ -234,6 +241,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isRight() { MotionEvent motionEventOrigin = obtainMotionEvent(MotionEvent.ACTION_DOWN, 1, 0, 0); Loading @@ -260,6 +268,7 @@ public class FalsingDataProviderTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void test_isUp() { // Remember that our y axis is flipped. Loading
packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/PointerCountClassifierTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading @@ -47,11 +48,13 @@ public class PointerCountClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_noPointer() { assertThat(mClassifier.isFalseTouch(), is(false)); } @Test @Ignore("Memory Leak?") public void testPass_singlePointer() { MotionEvent motionEvent = MotionEvent.obtain(1, 1, MotionEvent.ACTION_DOWN, 1, 1, 0); mClassifier.onTouchEvent(motionEvent); Loading @@ -60,6 +63,7 @@ public class PointerCountClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_multiPointer() { MotionEvent.PointerProperties[] pointerProperties = MotionEvent.PointerProperties.createArray(2); Loading
packages/SystemUI/tests/src/com/android/systemui/classifier/brightline/ProximityClassifierTest.java +7 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -64,6 +65,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_uncovered() { touchDown(); touchUp(10); Loading @@ -71,6 +73,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_mostlyUncovered() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading @@ -80,6 +83,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_quickSettings() { touchDown(); when(mDataProvider.getInteractionType()).thenReturn(QUICK_SETTINGS); Loading @@ -90,6 +94,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_covered() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading @@ -99,6 +104,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testFail_mostlyCovered() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading @@ -110,6 +116,7 @@ public class ProximityClassifierTest extends SysuiTestCase { } @Test @Ignore("Memory Leak?") public void testPass_coveredWithLongSwipe() { touchDown(); mClassifier.onSensorEvent(createSensorEvent(true, 1)); Loading