Search in sources :

Example 21 with DummyMainThread

use of com.google.android.exoplayer2.testutil.DummyMainThread in project ExoPlayer by google.

the class DownloadManagerDashTest method setUp.

@Before
public void setUp() throws Exception {
    ShadowLog.stream = System.out;
    testThread = new DummyMainThread();
    Context context = ApplicationProvider.getApplicationContext();
    tempFolder = Util.createTempDirectory(context, "ExoPlayerTest");
    File cacheFolder = new File(tempFolder, "cache");
    cacheFolder.mkdir();
    cache = new SimpleCache(cacheFolder, new NoOpCacheEvictor(), TestUtil.getInMemoryDatabaseProvider());
    MockitoAnnotations.initMocks(this);
    fakeDataSet = new FakeDataSet().setData(TEST_MPD_URI, TEST_MPD).setRandomData("audio_init_data", 10).setRandomData("audio_segment_1", 4).setRandomData("audio_segment_2", 5).setRandomData("audio_segment_3", 6).setRandomData("text_segment_1", 1).setRandomData("text_segment_2", 2).setRandomData("text_segment_3", 3);
    fakeStreamKey1 = new StreamKey(0, 0, 0);
    fakeStreamKey2 = new StreamKey(0, 1, 0);
    downloadIndex = new DefaultDownloadIndex(TestUtil.getInMemoryDatabaseProvider());
    createDownloadManager();
}
Also used : Context(android.content.Context) DefaultDownloadIndex(com.google.android.exoplayer2.offline.DefaultDownloadIndex) SimpleCache(com.google.android.exoplayer2.upstream.cache.SimpleCache) DummyMainThread(com.google.android.exoplayer2.testutil.DummyMainThread) NoOpCacheEvictor(com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor) FakeDataSet(com.google.android.exoplayer2.testutil.FakeDataSet) File(java.io.File) StreamKey(com.google.android.exoplayer2.offline.StreamKey) Before(org.junit.Before)

Aggregations

DummyMainThread (com.google.android.exoplayer2.testutil.DummyMainThread)20 Test (org.junit.Test)16 Timeline (com.google.android.exoplayer2.Timeline)8 FakeTimeline (com.google.android.exoplayer2.testutil.FakeTimeline)8 CountDownLatch (java.util.concurrent.CountDownLatch)8 Before (org.junit.Before)4 Context (android.content.Context)2 DefaultDownloadIndex (com.google.android.exoplayer2.offline.DefaultDownloadIndex)2 StreamKey (com.google.android.exoplayer2.offline.StreamKey)2 FakeDataSet (com.google.android.exoplayer2.testutil.FakeDataSet)2 FakeMediaSource (com.google.android.exoplayer2.testutil.FakeMediaSource)2 NoOpCacheEvictor (com.google.android.exoplayer2.upstream.cache.NoOpCacheEvictor)2 SimpleCache (com.google.android.exoplayer2.upstream.cache.SimpleCache)2 Notification (android.app.Notification)1 Handler (android.os.Handler)1 Nullable (androidx.annotation.Nullable)1 DefaultDownloaderFactory (com.google.android.exoplayer2.offline.DefaultDownloaderFactory)1 Download (com.google.android.exoplayer2.offline.Download)1 DownloadManager (com.google.android.exoplayer2.offline.DownloadManager)1 DownloadService (com.google.android.exoplayer2.offline.DownloadService)1