mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-29 08:20:34 +05:30
[Test] Add stream dash mpd url test
This commit is contained in:
parent
d0b14644bb
commit
880ff04a5c
@ -23,6 +23,7 @@ public interface BaseStreamExtractorTest extends BaseExtractorTest {
|
|||||||
void testAudioStreams() throws Exception;
|
void testAudioStreams() throws Exception;
|
||||||
void testVideoStreams() throws Exception;
|
void testVideoStreams() throws Exception;
|
||||||
void testSubtitles() throws Exception;
|
void testSubtitles() throws Exception;
|
||||||
|
void testGetDashMpdUrl() throws Exception;
|
||||||
void testFrames() throws Exception;
|
void testFrames() throws Exception;
|
||||||
void testHost() throws Exception;
|
void testHost() throws Exception;
|
||||||
void testPrivacy() throws Exception;
|
void testPrivacy() throws Exception;
|
||||||
|
@ -22,11 +22,11 @@ import java.util.TimeZone;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.containsString;
|
import static org.hamcrest.CoreMatchers.containsString;
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertAtLeast;
|
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertAtLeast;
|
||||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEqualsOrderIndependent;
|
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEqualsOrderIndependent;
|
||||||
@ -59,6 +59,7 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
|
|||||||
public boolean expectedHasVideoStreams() { return true; } // default: there are video streams
|
public boolean expectedHasVideoStreams() { return true; } // default: there are video streams
|
||||||
public boolean expectedHasAudioStreams() { return true; } // default: there are audio streams
|
public boolean expectedHasAudioStreams() { return true; } // default: there are audio streams
|
||||||
public boolean expectedHasSubtitles() { return true; } // default: there are subtitles streams
|
public boolean expectedHasSubtitles() { return true; } // default: there are subtitles streams
|
||||||
|
@Nullable public String expectedDashMpdUrlContains() { return null; } // default: no dash mpd
|
||||||
public boolean expectedHasFrames() { return true; } // default: there are frames
|
public boolean expectedHasFrames() { return true; } // default: there are frames
|
||||||
public String expectedHost() { return ""; } // default: no host for centralized platforms
|
public String expectedHost() { return ""; } // default: no host for centralized platforms
|
||||||
public String expectedPrivacy() { return ""; } // default: no privacy policy available
|
public String expectedPrivacy() { return ""; } // default: no privacy policy available
|
||||||
@ -306,6 +307,18 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void testGetDashMpdUrl() throws Exception {
|
||||||
|
final String dashMpdUrl = extractor().getDashMpdUrl();
|
||||||
|
if (expectedDashMpdUrlContains() == null) {
|
||||||
|
assertNotNull(dashMpdUrl);
|
||||||
|
assertTrue(dashMpdUrl.isEmpty());
|
||||||
|
} else {
|
||||||
|
assertIsSecureUrl(dashMpdUrl);
|
||||||
|
assertThat(extractor().getDashMpdUrl(), containsString(expectedDashMpdUrlContains()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Override
|
@Override
|
||||||
public void testFrames() throws Exception {
|
public void testFrames() throws Exception {
|
||||||
|
@ -50,5 +50,6 @@ public class YoutubeStreamExtractorLivestreamTest extends DefaultStreamExtractor
|
|||||||
@Override public long expectedLikeCountAtLeast() { return 825000; }
|
@Override public long expectedLikeCountAtLeast() { return 825000; }
|
||||||
@Override public long expectedDislikeCountAtLeast() { return 15600; }
|
@Override public long expectedDislikeCountAtLeast() { return 15600; }
|
||||||
@Override public boolean expectedHasSubtitles() { return false; }
|
@Override public boolean expectedHasSubtitles() { return false; }
|
||||||
|
@Nullable @Override public String expectedDashMpdUrlContains() { return "https://manifest.googlevideo.com/api/manifest/dash/"; }
|
||||||
@Override public boolean expectedHasFrames() { return false; }
|
@Override public boolean expectedHasFrames() { return false; }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user