Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Mark all the test >3s as @LargeTest
Browse files Browse the repository at this point in the history
Mark the tests that take longer than 3s to complete as @LargeTest.

Source of data:
https://dashboards.corp.google.com/google::_550f6bcf_09dd_4963_b94c_d243e37d002f?f=branch:in:ub-supportlib-master&f=test_tag:in:support_lib_presubmit

Test: None
Change-Id: I354d5a2367659bd5e93e481265784f54568e83be
  • Loading branch information
liutikas committed Jul 19, 2018
1 parent ea1f61a commit a191bfa
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 6 deletions.
Expand Up @@ -57,6 +57,7 @@
import androidx.test.espresso.Espresso;
import androidx.test.espresso.IdlingResource;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
Expand Down Expand Up @@ -228,6 +229,7 @@ public void testSwipeUpKeepsItemSnappedToTopOfList() {
verifyItemSnappedToListTop();
}

@LargeTest
@Test
public void testPageUpAndDownMoveSameDistance() {
setUpPagedListView(ITEMS_PER_PAGE * 10);
Expand Down
Expand Up @@ -30,6 +30,7 @@
import android.view.inputmethod.InputConnection;
import android.widget.EditText;

import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
Expand Down Expand Up @@ -60,6 +61,7 @@ public void testGetKeyListener_returnsSameKeyListener() {
assertSame(param, keyListener);
}

@LargeTest
@Test
public void testGetOnCreateInputConnection_returnsSameInputConnection() {
final InputConnection param = mock(InputConnection.class);
Expand Down
Expand Up @@ -558,7 +558,7 @@ public void testSetDateTime() throws IOException {
}

@Test
@SmallTest
@LargeTest
public void testRotation() throws IOException {
File imageFile = new File(
Environment.getExternalStorageDirectory(), EXIF_BYTE_ORDER_II_JPEG);
Expand Down
Expand Up @@ -46,6 +46,7 @@
import androidx.leanback.widget.RowPresenter;
import androidx.leanback.widget.SparseArrayObjectAdapter;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.filters.Suppress;
import androidx.test.runner.AndroidJUnit4;
Expand Down Expand Up @@ -392,6 +393,7 @@ public void onCreate(Bundle savedInstanceState) {
}
}

@LargeTest
@Test
public void autohideAfterPlaying() throws Throwable {
SingleFragmentTestActivity activity =
Expand Down
Expand Up @@ -43,6 +43,7 @@
import androidx.leanback.widget.RowPresenter;
import androidx.leanback.widget.SparseArrayObjectAdapter;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.filters.Suppress;
import androidx.test.runner.AndroidJUnit4;
Expand Down Expand Up @@ -389,6 +390,7 @@ public void onCreate(Bundle savedInstanceState) {
}
}

@LargeTest
@Test
public void autohideAfterPlaying() throws Throwable {
SingleSupportFragmentTestActivity activity =
Expand Down
Expand Up @@ -33,7 +33,7 @@
import androidx.leanback.R;
import androidx.leanback.app.TestActivity;
import androidx.leanback.testutils.PollingCheck;
import androidx.test.filters.SmallTest;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Before;
Expand All @@ -44,7 +44,7 @@

import java.util.Random;

@SmallTest
@LargeTest
@RunWith(AndroidJUnit4.class)
public class ImageCardViewTest {

Expand Down
Expand Up @@ -25,6 +25,7 @@

import androidx.leanback.R;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;

Expand Down Expand Up @@ -217,6 +218,7 @@ public void run() {
* be 1. According to the algorithm of calculateNumOfThumbs, it should be reassigned to 2 and
* the final result should be 3 after counting the hero thumb.
*/
@LargeTest
@Test
public void checkCalculateNumberOfThumbs1() {
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
Expand Down
Expand Up @@ -47,6 +47,7 @@
import androidx.media2.TestServiceRegistry.SessionServiceCallback;
import androidx.media2.TestUtils.SyncHandler;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
Expand Down Expand Up @@ -1298,12 +1299,14 @@ public void onCustomCommand(MediaController2 controller,
assertTrue(controllerLatch.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
}

@LargeTest
@Test
public void testControllerAfterSessionIsGone_session() throws InterruptedException {
prepareLooper();
testControllerAfterSessionIsClosed(mSession.getToken().getId());
}

@LargeTest
@Test
public void testControllerAfterSessionIsClosed_sessionService() throws InterruptedException {
prepareLooper();
Expand Down Expand Up @@ -1382,6 +1385,7 @@ public void testClose_twice() {
mController.close();
}

@LargeTest
@Test
public void testClose_session() throws InterruptedException {
prepareLooper();
Expand All @@ -1395,12 +1399,14 @@ public void testClose_session() throws InterruptedException {
testControllerAfterSessionIsClosed(id);
}

@LargeTest
@Test
public void testClose_sessionService() throws InterruptedException {
prepareLooper();
testCloseFromService(MockMediaSessionService2.ID);
}

@LargeTest
@Test
public void testClose_libraryService() throws InterruptedException {
prepareLooper();
Expand Down
Expand Up @@ -31,8 +31,8 @@
import android.os.Build;

import androidx.test.InstrumentationRegistry;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import androidx.test.rule.GrantPermissionRule;
import androidx.test.runner.AndroidJUnit4;

Expand All @@ -48,7 +48,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

@SmallTest
@LargeTest
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = 19)
public class RenderTest {
Expand Down
Expand Up @@ -22,6 +22,7 @@
import static org.mockito.Mockito.when;

import androidx.fragment.app.FragmentActivity;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;

Expand Down Expand Up @@ -61,6 +62,7 @@ public void setUp() {
.thenReturn(mMockWearableController);
}

@LargeTest
@Test
public void testNullActivity() {
mAmbientDelegateUnderTest = new AmbientDelegate(null,
Expand Down
Expand Up @@ -95,6 +95,7 @@ public void testIsTimerRunningAfterStop() {
assertEquals(false, mControllerUnderTest.isTimerRunning());
}

@LargeTest
@Test
@UiThreadTest
public void testSwitchFromIndeterminateToDeterminate() {
Expand Down
Expand Up @@ -25,6 +25,7 @@
import android.os.SystemClock;
import android.view.MotionEvent;

import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
Expand Down Expand Up @@ -75,6 +76,7 @@ public void testStraightUpScrollingGestureLeft() throws Throwable {
.scrollBy(0, 1);
}

@LargeTest
@Test
public void testStraightDownScrollingGestureLeft() throws Throwable {
// Pretend to scroll in a straight line upper left to center left
Expand Down
Expand Up @@ -279,6 +279,7 @@ public void testConstraintsChanged_withNoConstraints() throws InterruptedExcepti
assertThat(mLatch.getCount(), is(0L));
}

@LargeTest
@Test
public void testConstraintsChangedMarkedNotScheduled_withNoConstraints()
throws InterruptedException {
Expand Down
Expand Up @@ -163,7 +163,7 @@ public void testOnStopJob_ReschedulesWhenNotCancelled() {
}

@Test
@SmallTest
@LargeTest
public void testOnStopJob_DoesNotRescheduleWhenCancelled() {
// TODO: Remove after we figure out why these tests execute on API 17 emulators.
if (Build.VERSION.SDK_INT < WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) {
Expand Down

0 comments on commit a191bfa

Please sign in to comment.