| Index: chrome/test/data/media/eme_player_js/test_config.js
|
| diff --git a/chrome/test/data/media/eme_player_js/test_config.js b/chrome/test/data/media/eme_player_js/test_config.js
|
| index c3c36e97f97735355884c06f9ea8a07378d3b909..d26c438c8e3c9cd3371bb5ea1f1447ea2662920a 100644
|
| --- a/chrome/test/data/media/eme_player_js/test_config.js
|
| +++ b/chrome/test/data/media/eme_player_js/test_config.js
|
| @@ -8,13 +8,16 @@
|
| this.mediaFile = null;
|
| this.keySystem = null;
|
| this.mediaType = null;
|
| - this.licenseServerURL = null;
|
| + this.licenseServer = null;
|
| this.useSRC = false;
|
| this.usePrefixedEME = false;
|
| - this.runFPS = false
|
| }
|
|
|
| -TestConfig.loadQueryParams = function() {
|
| +TestConfig.updateDocument = function() {
|
| + Utils.addOptions(KEYSYSTEM_ELEMENT_ID, KEY_SYSTEMS);
|
| + Utils.addOptions(MEDIA_TYPE_ELEMENT_ID, MEDIA_TYPES);
|
| + Utils.addOptions(USE_PREFIXED_EME_ID, EME_VERSIONS_OPTIONS);
|
| +
|
| // Load query parameters and set default values.
|
| var r = /([^&=]+)=?([^&]*)/g;
|
| // Lambda function for decoding extracted match values. Replaces '+' with
|
| @@ -23,34 +26,29 @@
|
| return decodeURIComponent(s.replace(/\+/g, ' '));
|
| };
|
| var match;
|
| + var params = {};
|
| while (match = r.exec(window.location.search.substring(1)))
|
| - this[decodeURI(match[1])] = decodeURI(match[2]);
|
| -
|
| - this.useSRC = this.useSRC == '1' || this.useSRC == 'true';
|
| - this.usePrefixedEME =
|
| - this.usePrefixedEME == '1' || this.usePrefixedEME == 'true';
|
| -};
|
| -
|
| -TestConfig.updateDocument = function() {
|
| - this.loadQueryParams();
|
| - Utils.addOptions(KEYSYSTEM_ELEMENT_ID, KEY_SYSTEMS);
|
| - Utils.addOptions(MEDIA_TYPE_ELEMENT_ID, MEDIA_TYPES);
|
| - Utils.addOptions(USE_PREFIXED_EME_ID, EME_VERSIONS_OPTIONS,
|
| - EME_DISABLED_OPTIONS);
|
| + params[decodeURI(match[1])] = decodeURI(match[2]);
|
|
|
| document.getElementById(MEDIA_FILE_ELEMENT_ID).value =
|
| - this.mediaFile || DEFAULT_MEDIA_FILE;
|
| + params.mediaFile || DEFAULT_MEDIA_FILE;
|
|
|
| document.getElementById(LICENSE_SERVER_ELEMENT_ID).value =
|
| - this.licenseServerURL || DEFAULT_LICENSE_SERVER;
|
| + params.licenseServer || DEFAULT_LICENSE_SERVER;
|
|
|
| - if (this.keySystem)
|
| - Utils.ensureOptionInList(KEYSYSTEM_ELEMENT_ID, this.keySystem);
|
| - if (this.mediaType)
|
| - Utils.ensureOptionInList(MEDIA_TYPE_ELEMENT_ID, this.mediaType);
|
| - document.getElementById(USE_SRC_ELEMENT_ID).value = this.useSRC;
|
| - if (this.usePrefixedEME)
|
| - document.getElementById(USE_PREFIXED_EME_ID).value = EME_PREFIXED_VERSION;
|
| + if (params.keySystem)
|
| + document.getElementById(KEYSYSTEM_ELEMENT_ID).value = params.keySystem;
|
| + if (params.mediaType)
|
| + document.getElementById(MEDIA_TYPE_ELEMENT_ID).value = params.mediaType;
|
| + if (params.useSRC) {
|
| + params.useSRC = params.useSRC == '1' || params.useSRC == 'true';
|
| + document.getElementById(USE_SRC_ELEMENT_ID).value = params.useSRC;
|
| + }
|
| + if (params.usePrefixedEME) {
|
| + params.usePrefixedEME =
|
| + params.usePrefixedEME == '1' || params.usePrefixedEME == 'true';
|
| + document.getElementById(USE_PREFIXED_EME_ID).value = params.usePrefixedEME;
|
| + }
|
| };
|
|
|
| TestConfig.init = function() {
|
| @@ -59,8 +57,7 @@
|
| this.keySystem = document.getElementById(KEYSYSTEM_ELEMENT_ID).value;
|
| this.mediaType = document.getElementById(MEDIA_TYPE_ELEMENT_ID).value;
|
| this.useSRC = document.getElementById(USE_SRC_ELEMENT_ID).value == 'true';
|
| - this.usePrefixedEME = document.getElementById(USE_PREFIXED_EME_ID).value ==
|
| - EME_PREFIXED_VERSION;
|
| - this.licenseServerURL =
|
| - document.getElementById(LICENSE_SERVER_ELEMENT_ID).value;
|
| + this.usePrefixedEME =
|
| + document.getElementById(USE_PREFIXED_EME_ID).value == 'true';
|
| + this.licenseServer = document.getElementById(LICENSE_SERVER_ELEMENT_ID).value;
|
| };
|
|
|