diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-06-29 13:23:27 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-06-29 13:23:27 +0200 |
commit | 4f8c934595f5d2aa01b642d7d4489de3ad25df39 (patch) | |
tree | 707fee32c51ba2b37714d54f280b161eaf101e65 /src/instrumentationTest/de | |
parent | bb6c360cb7bfb8cb59397d5959661632c51dd32b (diff) | |
download | AntennaPod-4f8c934595f5d2aa01b642d7d4489de3ad25df39.zip |
Improved timecode link insertion
Diffstat (limited to 'src/instrumentationTest/de')
-rw-r--r-- | src/instrumentationTest/de/test/antennapod/util/playback/TimelineTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/util/playback/TimelineTest.java b/src/instrumentationTest/de/test/antennapod/util/playback/TimelineTest.java index 5ba6999cd..1b1d011d4 100644 --- a/src/instrumentationTest/de/test/antennapod/util/playback/TimelineTest.java +++ b/src/instrumentationTest/de/test/antennapod/util/playback/TimelineTest.java @@ -60,6 +60,36 @@ public class TimelineTest extends InstrumentationTestCase { checkLinkCorrect(res, new long[]{time}, new String[]{timeStr}); } + public void testProcessShownotesAddTimecodeParentheses() throws Exception { + final String timeStr = "10:11"; + final long time = 3600 * 1000 * 10 + 60 * 1000 * 11; + + Playable p = newTestPlayable(null, "<p> Some test text with a timecode (" + timeStr + ") here.</p>"); + Timeline t = new Timeline(context, p); + String res = t.processShownotes(true); + checkLinkCorrect(res, new long[]{time}, new String[]{timeStr}); + } + + public void testProcessShownotesAddTimecodeBrackets() throws Exception { + final String timeStr = "10:11"; + final long time = 3600 * 1000 * 10 + 60 * 1000 * 11; + + Playable p = newTestPlayable(null, "<p> Some test text with a timecode [" + timeStr + "] here.</p>"); + Timeline t = new Timeline(context, p); + String res = t.processShownotes(true); + checkLinkCorrect(res, new long[]{time}, new String[]{timeStr}); + } + + public void testProcessShownotesAddTimecodeAngleBrackets() throws Exception { + final String timeStr = "10:11"; + final long time = 3600 * 1000 * 10 + 60 * 1000 * 11; + + Playable p = newTestPlayable(null, "<p> Some test text with a timecode <" + timeStr + "> here.</p>"); + Timeline t = new Timeline(context, p); + String res = t.processShownotes(true); + checkLinkCorrect(res, new long[]{time}, new String[]{timeStr}); + } + private void checkLinkCorrect(String res, long[] timecodes, String[] timecodeStr) { assertNotNull(res); Document d = Jsoup.parse(res); |