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
1475f78d
authored
Aug 20, 2020
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix tests
parent
bcc4f797
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
library/common/src/test/java/com/google/android/exoplayer2/util/UtilTest.java
library/core/src/test/java/com/google/android/exoplayer2/util/UtilTest.java
library/common/src/test/java/com/google/android/exoplayer2/util/UtilTest.java
deleted
100644 → 0
View file @
bcc4f797
This diff is collapsed.
Click to expand it.
library/core/src/test/java/com/google/android/exoplayer2/util/UtilTest.java
View file @
1475f78d
...
@@ -24,6 +24,7 @@ import static com.google.android.exoplayer2.util.Util.parseXsDuration;
...
@@ -24,6 +24,7 @@ import static com.google.android.exoplayer2.util.Util.parseXsDuration;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Util
.
unescapeFileName
;
import
static
com
.
google
.
android
.
exoplayer2
.
util
.
Util
.
unescapeFileName
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
android.net.Uri
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
...
@@ -115,13 +116,39 @@ public class UtilTest {
...
@@ -115,13 +116,39 @@ public class UtilTest {
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.ism/Manifest"
)).
isEqualTo
(
C
.
TYPE_SS
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.ism/Manifest"
)).
isEqualTo
(
C
.
TYPE_SS
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.isml/manifest"
)).
isEqualTo
(
C
.
TYPE_SS
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.isml/manifest"
)).
isEqualTo
(
C
.
TYPE_SS
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.isml/manifest(filter=x)"
)).
isEqualTo
(
C
.
TYPE_SS
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.isml/manifest(filter=x)"
)).
isEqualTo
(
C
.
TYPE_SS
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.isml/manifest_hd"
)).
isEqualTo
(
C
.
TYPE_SS
);
}
}
@Test
@Test
public
void
inferContentType_handlesOtherIsmUris
()
{
public
void
inferContentType_handlesOtherIsmUris
()
{
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.ism/video.mp4"
)).
isEqualTo
(
C
.
TYPE_OTHER
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.ism/video.mp4"
)).
isEqualTo
(
C
.
TYPE_OTHER
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.ism/prefix-manifest"
)).
isEqualTo
(
C
.
TYPE_OTHER
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.ism/prefix-manifest"
)).
isEqualTo
(
C
.
TYPE_OTHER
);
assertThat
(
Util
.
inferContentType
(
"http://a.b/c.ism/manifest-suffix"
)).
isEqualTo
(
C
.
TYPE_OTHER
);
}
@Test
public
void
fixSmoothStreamingIsmManifestUri_addsManifestSuffix
()
{
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.ism"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest"
));
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.isml"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.isml/Manifest"
));
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.ism/"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest"
));
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.isml/"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.isml/Manifest"
));
}
@Test
public
void
fixSmoothStreamingIsmManifestUri_doesNotAlterManifestUri
()
{
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest"
));
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.isml/Manifest"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.isml/Manifest"
));
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest(filter=x)"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest(filter=x)"
));
assertThat
(
Util
.
fixSmoothStreamingIsmManifestUri
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest_hd"
)))
.
isEqualTo
(
Uri
.
parse
(
"http://a.b/c.ism/Manifest_hd"
));
}
}
@Test
@Test
...
...
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