summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
diff options
context:
space:
mode:
authorNathan Mascitelli <mascitelli.nathan@gmail.com>2019-02-13 21:06:19 -0500
committerNathan Mascitelli <mascitelli.nathan@gmail.com>2019-02-13 21:06:19 -0500
commite94e4bc3d03d2e6d5122700fd3161bfa63dc4371 (patch)
tree8f1f237a0180e900bfd1d793c57541b517da40f2 /app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
parentc49e98b5462c9511dffe250a94b17be637884c49 (diff)
downloadAntennaPod-e94e4bc3d03d2e6d5122700fd3161bfa63dc4371.zip
Use a single format for short timecodes
It is unlikely that multiple formats for short timecodes would be used in one document. Therefor we will parse all the short timecodes to see if they are all less then the duration as HH:MM. If they are we will use that, otherwise we will parse them as MM:SS.
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java')
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java b/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
index 157773595..e6b11a4b0 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
@@ -110,12 +110,14 @@ public class TimelineTest extends InstrumentationTestCase {
}
public void testProcessShownotesAddTimecodeMultipleShortFormatNoChapters() throws Exception {
+
+ // One of these timecodes fits as HH:MM and one does not so both should be parsed as MM:SS.
final String[] timeStrings = new String[]{ "10:12", "2:12" };
Playable p = newTestPlayable(null, "<p> Some test text with a timecode " + timeStrings[0] + " here. Hey look another one " + timeStrings[1] + " here!</p>", 3 * 60 * 60 * 1000);
Timeline t = new Timeline(context, p);
String res = t.processShownotes(true);
- checkLinkCorrect(res, new long[]{ 10 * 60 * 1000 + 12 * 1000, 2 * 60 * 60 * 1000 + 12 * 60 * 1000 }, timeStrings);
+ checkLinkCorrect(res, new long[]{ 10 * 60 * 1000 + 12 * 1000, 2 * 60 * 1000 + 12 * 1000 }, timeStrings);
}
public void testProcessShownotesAddTimecodeParentheses() throws Exception {