Search in sources :

Example 31 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project android_frameworks_base by ParanoidAndroid.

the class IncludeTest method testIncludedWithLayoutParams.

@MediumTest
public void testIncludedWithLayoutParams() throws Exception {
    final Include activity = getActivity();
    final View button1 = activity.findViewById(R.id.included_button);
    final View button2 = activity.findViewById(R.id.included_button_overriden);
    assertTrue("Both buttons should have different width", button1.getLayoutParams().width != button2.getLayoutParams().width);
    assertTrue("Both buttons should have different height", button1.getLayoutParams().height != button2.getLayoutParams().height);
}
Also used : Include(android.view.Include) View(android.view.View) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 32 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project android_frameworks_base by ParanoidAndroid.

the class IncludeTest method testIncluded.

@MediumTest
public void testIncluded() throws Exception {
    final Include activity = getActivity();
    final View button1 = activity.findViewById(R.id.included_button);
    assertNotNull("The layout include_button was not included", button1);
    final View button2 = activity.findViewById(R.id.included_button_overriden);
    assertNotNull("The layout include_button was not included with overriden id", button2);
}
Also used : Include(android.view.Include) View(android.view.View) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 33 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project android_frameworks_base by ParanoidAndroid.

the class VelocityTest method testDragDeceleration.

@MediumTest
public void testDragDeceleration() {
    long t = System.currentTimeMillis();
    VelocityTracker vt = VelocityTracker.obtain();
    drag(vt, 100, 200, 100, 200, 15, t, 400, new DecelerateInterpolator());
    vt.computeCurrentVelocity(1000);
    assertLower(250.0f, vt.getXVelocity());
    assertLower(250.0f, vt.getYVelocity());
    vt.recycle();
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) VelocityTracker(android.view.VelocityTracker) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 34 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project android_frameworks_base by ParanoidAndroid.

the class VelocityTest method testStabilityInNbPoints.

/**
     * Velocity is independent of the number of points used during
     * the same interval
     */
@MediumTest
public void testStabilityInNbPoints() {
    long t = System.currentTimeMillis();
    VelocityTracker vt = VelocityTracker.obtain();
    // 10 steps over 400ms
    drag(vt, 100, 200, 100, 200, 10, t, 400);
    vt.computeCurrentVelocity(1);
    float firstX = vt.getXVelocity();
    float firstY = vt.getYVelocity();
    vt.clear();
    // 20 steps over 400ms
    drag(vt, 100, 200, 100, 200, 20, t, 400);
    vt.computeCurrentVelocity(1);
    float secondX = vt.getXVelocity();
    float secondY = vt.getYVelocity();
    assertEqualFuzzy(firstX, secondX, 0.1f);
    assertEqualFuzzy(firstY, secondY, 0.1f);
    vt.recycle();
}
Also used : VelocityTracker(android.view.VelocityTracker) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 35 with MediumTest

use of android.test.suitebuilder.annotation.MediumTest in project android_frameworks_base by ParanoidAndroid.

the class VelocityTest method testClear.

/**
     * Test that {@link android.view.VelocityTracker}.clear() clears
     * the previous values after a call to computeCurrentVelocity()
     */
@MediumTest
public void testClear() {
    long t = System.currentTimeMillis();
    VelocityTracker vt = VelocityTracker.obtain();
    drag(vt, 100, 200, 100, 200, 10, t, 300);
    vt.computeCurrentVelocity(1);
    assertFalse("Velocity should not be null", vt.getXVelocity() == 0.0f);
    assertFalse("Velocity should not be null", vt.getYVelocity() == 0.0f);
    vt.clear();
    vt.computeCurrentVelocity(1);
    assertEquals(0.0f, vt.getXVelocity());
    assertEquals(0.0f, vt.getYVelocity());
    vt.recycle();
}
Also used : VelocityTracker(android.view.VelocityTracker) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

MediumTest (android.test.suitebuilder.annotation.MediumTest)1023 View (android.view.View)246 ListView (android.widget.ListView)151 Cursor (android.database.Cursor)116 Handler (android.os.Handler)116 Suppress (android.test.suitebuilder.annotation.Suppress)73 TextView (android.widget.TextView)67 ContentValues (android.content.ContentValues)63 ServiceStatus (com.vodafone360.people.service.ServiceStatus)60 SQLiteCursor (android.database.sqlite.SQLiteCursor)54 SQLiteStatement (android.database.sqlite.SQLiteStatement)49 IOException (java.io.IOException)49 UiThreadTest (android.test.UiThreadTest)48 Message (android.os.Message)43 LogRec (com.android.internal.util.StateMachine.LogRec)42 Intent (android.content.Intent)40 ContentResolver (android.content.ContentResolver)37 GridView (android.widget.GridView)36 InputStream (java.io.InputStream)36 ByteArrayInputStream (java.io.ByteArrayInputStream)35