|
22 | 22 | import javax.annotation.Nullable; |
23 | 23 |
|
24 | 24 | import static org.hamcrest.CoreMatchers.containsString; |
| 25 | +import static org.hamcrest.MatcherAssert.assertThat; |
25 | 26 | import static org.junit.Assert.assertEquals; |
26 | 27 | import static org.junit.Assert.assertFalse; |
27 | 28 | import static org.junit.Assert.assertNotNull; |
28 | 29 | import static org.junit.Assert.assertNull; |
29 | | -import static org.junit.Assert.assertThat; |
30 | 30 | import static org.junit.Assert.assertTrue; |
31 | 31 | import static org.schabi.newpipe.extractor.ExtractorAsserts.assertAtLeast; |
32 | 32 | import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEqualsOrderIndependent; |
@@ -59,6 +59,7 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St |
59 | 59 | public boolean expectedHasVideoStreams() { return true; } // default: there are video streams |
60 | 60 | public boolean expectedHasAudioStreams() { return true; } // default: there are audio streams |
61 | 61 | public boolean expectedHasSubtitles() { return true; } // default: there are subtitles streams |
| 62 | + @Nullable public String expectedDashMpdUrlContains() { return null; } // default: no dash mpd |
62 | 63 | public boolean expectedHasFrames() { return true; } // default: there are frames |
63 | 64 | public String expectedHost() { return ""; } // default: no host for centralized platforms |
64 | 65 | public String expectedPrivacy() { return ""; } // default: no privacy policy available |
@@ -306,6 +307,18 @@ public void testSubtitles() throws Exception { |
306 | 307 | } |
307 | 308 | } |
308 | 309 |
|
| 310 | + @Override |
| 311 | + public void testGetDashMpdUrl() throws Exception { |
| 312 | + final String dashMpdUrl = extractor().getDashMpdUrl(); |
| 313 | + if (expectedDashMpdUrlContains() == null) { |
| 314 | + assertNotNull(dashMpdUrl); |
| 315 | + assertTrue(dashMpdUrl.isEmpty()); |
| 316 | + } else { |
| 317 | + assertIsSecureUrl(dashMpdUrl); |
| 318 | + assertThat(extractor().getDashMpdUrl(), containsString(expectedDashMpdUrlContains())); |
| 319 | + } |
| 320 | + } |
| 321 | + |
309 | 322 | @Test |
310 | 323 | @Override |
311 | 324 | public void testFrames() throws Exception { |
|
0 commit comments