From 3e9a45b9d360760cd82216e6cc072a3107b18a9a Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 23 Apr 2019 11:23:34 +0100 Subject: [PATCH] Fix DownloadManagerDashTest tests Also re-enable two of them, although note that the fix here is not related to the flakiness that caused them to be disabled. I'm re-enabling them since much has changed in DownloadManager, and the hope is that these tests are no longer flaky. PiperOrigin-RevId: 244826225 --- .../source/dash/offline/DownloadManagerDashTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java index 8cd6154373..56fedbefd0 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java @@ -32,6 +32,7 @@ import com.google.android.exoplayer2.offline.DownloadManager; import com.google.android.exoplayer2.offline.DownloadRequest; import com.google.android.exoplayer2.offline.DownloaderConstructorHelper; import com.google.android.exoplayer2.offline.StreamKey; +import com.google.android.exoplayer2.scheduler.Requirements; import com.google.android.exoplayer2.testutil.DummyMainThread; import com.google.android.exoplayer2.testutil.DummyMainThread.TestRunnable; import com.google.android.exoplayer2.testutil.FakeDataSet; @@ -190,8 +191,6 @@ public class DownloadManagerDashTest { assertCacheEmpty(cache); } - // Disabled due to flakiness. - @Ignore @Test public void testHandleRemoveActionBeforeDownloadFinish() throws Throwable { handleDownloadRequest(fakeStreamKey1); @@ -202,8 +201,6 @@ public class DownloadManagerDashTest { assertCacheEmpty(cache); } - // Disabled due to flakiness [Internal: b/122290449]. - @Ignore @Test public void testHandleInterferingRemoveAction() throws Throwable { final ConditionVariable downloadInProgressCondition = new ConditionVariable(); @@ -259,6 +256,7 @@ public class DownloadManagerDashTest { downloadIndex, new DefaultDownloaderFactory( new DownloaderConstructorHelper(cache, fakeDataSourceFactory))); + downloadManager.setRequirements(new Requirements(0)); downloadManagerListener = new TestDownloadManagerListener(