Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f937cd7 authored by Diksha Gohlyan's avatar Diksha Gohlyan Committed by Android (Google) Code Review
Browse files

Merge "Make search tests not flaky" into rvc-dev

parents 95ed12d4 973427b1
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -412,12 +412,16 @@ public final class SearchViewManagerTest {
        mSearchViewManager.onClick(null);
        mSearchChipViewManager.mCheckedChipItems = getFakeSearchChipDataList();

        final long startTime = LocalDate.now().minusDays(7).atStartOfDay(ZoneId.systemDefault())
                .toInstant().toEpochMilli();

        final Bundle queryArgs = mSearchViewManager.buildQueryArgs();
        assertFalse(queryArgs.isEmpty());

        final long endTime  = LocalDate.now().minusDays(7).atStartOfDay(ZoneId.systemDefault())
                .toInstant().toEpochMilli();
        final long weekAgoTime = queryArgs.getLong(QUERY_ARG_LAST_MODIFIED_AFTER);
        assertEquals(LocalDate.now().minusDays(7).atStartOfDay(ZoneId.systemDefault())
                .toInstant().toEpochMilli(), weekAgoTime);
        assertTrue(weekAgoTime == endTime || weekAgoTime == startTime);
    }

    @Test