diff options
author | ByteHamster <info@bytehamster.com> | 2020-08-15 19:48:23 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-08-15 19:48:23 +0200 |
commit | d8674e8050fd98961f7eaa9fa844eb03d8bbfb48 (patch) | |
tree | 14c3cf71186072ce6383610d2a07c57988af01ee /app/src/androidTest/java | |
parent | 5a4cb23877c4d7a33b578ab8b726774586c7c851 (diff) | |
parent | 06315821d52d6b66d4c3c0adeac16ee627bfe782 (diff) | |
download | AntennaPod-d8674e8050fd98961f7eaa9fa844eb03d8bbfb48.zip |
Merge branch 'master' into develop
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/handler/RssParserTest.java | 21 | ||||
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java | 7 |
2 files changed, 28 insertions, 0 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/handler/RssParserTest.java b/app/src/androidTest/java/de/test/antennapod/handler/RssParserTest.java index d137bb459..c2e319233 100644 --- a/app/src/androidTest/java/de/test/antennapod/handler/RssParserTest.java +++ b/app/src/androidTest/java/de/test/antennapod/handler/RssParserTest.java @@ -2,6 +2,8 @@ package de.test.antennapod.handler; import androidx.test.filters.SmallTest; import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.core.feed.MediaType; +import de.danoeh.antennapod.core.syndication.namespace.NSMedia; import de.test.antennapod.util.syndication.feedgenerator.Rss2Generator; import org.junit.Test; import org.xmlpull.v1.XmlSerializer; @@ -39,4 +41,23 @@ public class RssParserTest extends FeedParserTestBase { }, "UTF-8", 0); assertEquals(image, f2.getImageUrl()); } + + @Test + public void testMediaContentMime() throws Exception { + Feed f1 = createTestFeed(0, false); + f1.setImageUrl(null); + Feed f2 = runFeedTest(f1, new Rss2Generator() { + @Override + protected void writeAdditionalAttributes(XmlSerializer xml) throws IOException { + xml.setPrefix(NSMedia.NSTAG, NSMedia.NSURI); + xml.startTag(null, "item"); + xml.startTag(NSMedia.NSURI, "content"); + xml.attribute(null, "url", "https://www.example.com/file.mp4"); + xml.attribute(null, "medium", "video"); + xml.endTag(NSMedia.NSURI, "content"); + xml.endTag(null, "item"); + } + }, "UTF-8", 0); + assertEquals(MediaType.VIDEO, f2.getItems().get(0).getMedia().getMediaType()); + } } diff --git a/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java b/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java index 4893d7d82..7f26ff612 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/URLCheckerTest.java @@ -57,6 +57,13 @@ public class URLCheckerTest { } @Test + public void testItpcProtocolWithScheme() { + final String in = "itpc://https://example.com"; + final String out = URLChecker.prepareURL(in); + assertEquals("https://example.com", out); + } + + @Test public void testWhiteSpaceUrlShouldNotAppend() { final String in = "\n http://example.com \t"; final String out = URLChecker.prepareURL(in); |