diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2020-07-22 17:55:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-22 17:55:04 +0200 |
commit | 03190dfa20db70a72c6accfd9176126bd68467d6 (patch) | |
tree | fbf1be4df73eba3c1af87b50c8ad12c01fc1f94e /app/src/androidTest/java | |
parent | a3a5a58ae64999a91251205517242290724e2ae2 (diff) | |
parent | 51bbf1a5f9275e1d1bb526c43b0703ae13b349b9 (diff) | |
download | AntennaPod-03190dfa20db70a72c6accfd9176126bd68467d6.zip |
Merge pull request #4306 from ByteHamster/mime-type-media-content
Fixed mime type in media:content
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/handler/RssParserTest.java | 21 |
1 files changed, 21 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()); + } } |