Chromium Code Reviews| 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 d26c438c8e3c9cd3371bb5ea1f1447ea2662920a..378154481eb6efbc80f4319485dd1380aedaadda 100644 |
| --- a/chrome/test/data/media/eme_player_js/test_config.js |
| +++ b/chrome/test/data/media/eme_player_js/test_config.js |
| @@ -8,16 +8,13 @@ var TestConfig = new function() { |
| this.mediaFile = null; |
| this.keySystem = null; |
| this.mediaType = null; |
| - this.licenseServer = null; |
| + this.licenseServerURL = null; |
| this.useSRC = false; |
| this.usePrefixedEME = false; |
| + this.runFPS = false |
| } |
| -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); |
| - |
| +TestConfig.loadQueryParams = function() { |
| // Load query parameters and set default values. |
| var r = /([^&=]+)=?([^&]*)/g; |
| // Lambda function for decoding extracted match values. Replaces '+' with |
| @@ -28,27 +25,33 @@ TestConfig.updateDocument = function() { |
| var match; |
| var params = {}; |
|
jrummell
2014/05/29 21:45:05
Is params needed anymore?
shadi
2014/05/31 00:31:37
Done.
|
| while (match = r.exec(window.location.search.substring(1))) |
| - params[decodeURI(match[1])] = decodeURI(match[2]); |
| + 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); |
| document.getElementById(MEDIA_FILE_ELEMENT_ID).value = |
| - params.mediaFile || DEFAULT_MEDIA_FILE; |
| + this.mediaFile || DEFAULT_MEDIA_FILE; |
| document.getElementById(LICENSE_SERVER_ELEMENT_ID).value = |
| - params.licenseServer || DEFAULT_LICENSE_SERVER; |
| - |
| - 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; |
| - } |
| + this.licenseServerURL || DEFAULT_LICENSE_SERVER; |
| + |
| + if (this.keySystem) |
| + Utils.ensureOptionInList(KEYSYSTEM_ELEMENT_ID, this.keySystem); |
| + // document.getElementById(KEYSYSTEM_ELEMENT_ID).value = this.keySystem; |
| + if (this.mediaType) |
| + Utils.ensureOptionInList(MEDIA_TYPE_ELEMENT_ID, this.mediaType); |
| + //document.getElementById(MEDIA_TYPE_ELEMENT_ID).value = this.mediaType; |
| + document.getElementById(USE_SRC_ELEMENT_ID).value = this.useSRC; |
| + document.getElementById(USE_PREFIXED_EME_ID).value = this.usePrefixedEME; |
| }; |
| TestConfig.init = function() { |
| @@ -59,5 +62,6 @@ TestConfig.init = function() { |
| this.useSRC = document.getElementById(USE_SRC_ELEMENT_ID).value == 'true'; |
| this.usePrefixedEME = |
| document.getElementById(USE_PREFIXED_EME_ID).value == 'true'; |
| - this.licenseServer = document.getElementById(LICENSE_SERVER_ELEMENT_ID).value; |
| + this.licenseServerURL = |
| + document.getElementById(LICENSE_SERVER_ELEMENT_ID).value; |
| }; |