Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
55ff5551
authored
Oct 14, 2019
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix DashManifestParserTest in release branch
parent
a9a1cb77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
76 deletions
build.gradle
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java
build.gradle
View file @
55ff5551
...
...
@@ -28,7 +28,7 @@ allprojects {
jcenter
()
}
project
.
ext
{
exoplayerPublishEnabled
=
fals
e
exoplayerPublishEnabled
=
tru
e
}
if
(
it
.
hasProperty
(
'externalBuildDir'
))
{
if
(!
new
File
(
externalBuildDir
).
isAbsolute
())
{
...
...
library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java
View file @
55ff5551
...
...
@@ -26,11 +26,14 @@ import com.google.android.exoplayer2.metadata.emsg.EventMessage;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.IOException
;
import
java.io.StringReader
;
import
java.nio.charset.Charset
;
import
java.util.Collections
;
import
java.util.List
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.xmlpull.v1.XmlPullParser
;
import
org.xmlpull.v1.XmlPullParserFactory
;
/** Unit tests for {@link DashManifestParser}. */
@RunWith
(
AndroidJUnit4
.
class
)
...
...
@@ -189,81 +192,6 @@ public class DashManifestParserTest {
}
@Test
public
void
parseSegmentTimeline_repeatCount
()
throws
Exception
{
DashManifestParser
parser
=
new
DashManifestParser
();
XmlPullParser
xpp
=
XmlPullParserFactory
.
newInstance
().
newPullParser
();
xpp
.
setInput
(
new
StringReader
(
"<SegmentTimeline><S d=\"96000\" r=\"2\"/><S d=\"48000\" r=\"0\"/></SegmentTimeline>"
+
NEXT_TAG
));
xpp
.
next
();
List
<
SegmentTimelineElement
>
elements
=
parser
.
parseSegmentTimeline
(
xpp
,
/* timescale= */
48000
,
/* periodDurationMs= */
10000
);
assertThat
(
elements
)
.
containsExactly
(
new
SegmentTimelineElement
(
/* startTime= */
0
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
96000
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
192000
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
288000
,
/* duration= */
48000
))
.
inOrder
();
assertNextTag
(
xpp
);
}
@Test
public
void
parseSegmentTimeline_singleUndefinedRepeatCount
()
throws
Exception
{
DashManifestParser
parser
=
new
DashManifestParser
();
XmlPullParser
xpp
=
XmlPullParserFactory
.
newInstance
().
newPullParser
();
xpp
.
setInput
(
new
StringReader
(
"<SegmentTimeline><S d=\"96000\" r=\"-1\"/></SegmentTimeline>"
+
NEXT_TAG
));
xpp
.
next
();
List
<
SegmentTimelineElement
>
elements
=
parser
.
parseSegmentTimeline
(
xpp
,
/* timescale= */
48000
,
/* periodDurationMs= */
10000
);
assertThat
(
elements
)
.
containsExactly
(
new
SegmentTimelineElement
(
/* startTime= */
0
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
96000
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
192000
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
288000
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
384000
,
/* duration= */
96000
))
.
inOrder
();
assertNextTag
(
xpp
);
}
@Test
public
void
parseSegmentTimeline_timeOffsetsAndUndefinedRepeatCount
()
throws
Exception
{
DashManifestParser
parser
=
new
DashManifestParser
();
XmlPullParser
xpp
=
XmlPullParserFactory
.
newInstance
().
newPullParser
();
xpp
.
setInput
(
new
StringReader
(
"<SegmentTimeline><S t=\"0\" "
+
"d=\"96000\" r=\"-1\"/><S t=\"192000\" d=\"48000\" r=\"-1\"/>"
+
"</SegmentTimeline>"
+
NEXT_TAG
));
xpp
.
next
();
List
<
SegmentTimelineElement
>
elements
=
parser
.
parseSegmentTimeline
(
xpp
,
/* timescale= */
48000
,
/* periodDurationMs= */
10000
);
assertThat
(
elements
)
.
containsExactly
(
new
SegmentTimelineElement
(
/* startTime= */
0
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
96000
,
/* duration= */
96000
),
new
SegmentTimelineElement
(
/* startTime= */
192000
,
/* duration= */
48000
),
new
SegmentTimelineElement
(
/* startTime= */
240000
,
/* duration= */
48000
),
new
SegmentTimelineElement
(
/* startTime= */
288000
,
/* duration= */
48000
),
new
SegmentTimelineElement
(
/* startTime= */
336000
,
/* duration= */
48000
),
new
SegmentTimelineElement
(
/* startTime= */
384000
,
/* duration= */
48000
),
new
SegmentTimelineElement
(
/* startTime= */
432000
,
/* duration= */
48000
))
.
inOrder
();
assertNextTag
(
xpp
);
}
@Test
public
void
parseLabel
()
throws
Exception
{
DashManifestParser
parser
=
new
DashManifestParser
();
XmlPullParser
xpp
=
XmlPullParserFactory
.
newInstance
().
newPullParser
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment