summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorin Apostol <florin.apostol@oregan.net>2015-07-22 11:42:23 +0100
committerThiago Santos <thiagoss@osg.samsung.com>2015-08-01 11:52:26 -0300
commit86c12c73571c91e64dc18057403cefe27770487d (patch)
tree542be230cb932f2316844907480d6946110b37bb /tests
parent2df67f9da0705ae4f29e98832aec6d0762b7d73c (diff)
downloadgstreamer-plugins-bad-86c12c73571c91e64dc18057403cefe27770487d.tar.gz
dashdemux: tests: update unit test for baseURL
Update the unit test for baseURL to test that it is properly resolved taking into account parent baseURL elements. https://bugzilla.gnome.org/show_bug.cgi?id=752776
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/dash_mpd.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/check/elements/dash_mpd.c b/tests/check/elements/dash_mpd.c
index d036994a0..dc3dd5455 100644
--- a/tests/check/elements/dash_mpd.c
+++ b/tests/check/elements/dash_mpd.c
@@ -2937,10 +2937,13 @@ GST_START_TEST (dash_mpdparser_get_baseURL)
"<?xml version=\"1.0\"?>"
"<MPD xmlns=\"urn:mpeg:dash:schema:mpd:2011\""
" profiles=\"urn:mpeg:dash:profile:isoff-main:2011\">"
- " <BaseURL>http://example.com/</BaseURL>"
+ " <BaseURL>mpd_base_url/</BaseURL>"
" <Period id=\"Period0\" duration=\"P0Y0M1DT1H1M1S\">"
+ " <BaseURL> /period_base_url/</BaseURL>"
" <AdaptationSet id=\"1\" mimeType=\"audio\" lang=\"en\">"
+ " <BaseURL>adaptation_base_url</BaseURL>"
" <Representation>"
+ " <BaseURL>representation_base_url</BaseURL>"
" </Representation></AdaptationSet></Period></MPD>";
gboolean ret;
@@ -2968,9 +2971,23 @@ GST_START_TEST (dash_mpdparser_get_baseURL)
activeStreams = gst_mpdparser_get_nb_active_stream (mpdclient);
assert_equals_int (activeStreams, adaptationSetsCount);
+ /* test baseURL. Its value should be computed like this:
+ * - start with xml url (null)
+ * - set it to the value from MPD's BaseURL element: "mpd_base_url/"
+ * - update the value with BaseURL element from Period. Because Period's
+ * baseURL is absolute (starts with /) it will overwrite the current value
+ * for baseURL. So, baseURL becomes "/period_base_url/"
+ * - update the value with BaseURL element from AdaptationSet. Because this
+ * is a relative url, it will update the current value. baseURL becomes
+ * "/period_base_url/adaptation_base_url"
+ * - update the value with BaseURL element from Representation. Because this
+ * is a relative url, it will update the current value. Because the current
+ * value does not end in /, everything after the last / will be overwritten.
+ * baseURL becomes "/period_base_url/representation_base_url"
+ */
baseURL = gst_mpdparser_get_baseURL (mpdclient, 0);
fail_if (baseURL == NULL);
- assert_equals_string (baseURL, "http://example.com/");
+ assert_equals_string (baseURL, "/period_base_url/representation_base_url");
gst_mpd_client_free (mpdclient);
}