Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Unified Diff: media/test/data/mse_config_change.html

Issue 2543623003: media: Allow config change between clear and encrypted streams (Closed)
Patch Set: comments addressed Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/test/data/eme_player_js/test_config.js ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/data/mse_config_change.html
diff --git a/media/test/data/mse_config_change.html b/media/test/data/mse_config_change.html
index 9234b65a9072b98fe3ef621a4efb6acb452d8d08..bb75d2581f5163468e253e8039af6e20d5aa6233 100644
--- a/media/test/data/mse_config_change.html
+++ b/media/test/data/mse_config_change.html
@@ -31,17 +31,43 @@
// Append MEDIA_2 source at APPEND_TIME, so expected total duration is:
var TOTAL_DURATION = APPEND_TIME + MEDIA_2_LENGTH;
+ var firstFile;
+ var secondFile;
+
function initTestConfig() {
testConfig = new TestConfig();
testConfig.loadQueryParams();
}
+ function setMediaFiles() {
+ switch (testConfig.configChangeType) {
+ case CONFIG_CHANGE_TYPE.CLEAR_TO_CLEAR:
+ console.log('Config change type: clear to clear.');
+ firstFile = CLEAR_MEDIA_1;
+ secondFile = CLEAR_MEDIA_2;
+ break;
+ case CONFIG_CHANGE_TYPE.CLEAR_TO_ENCRYPTED:
+ console.log('Config change type: clear to encrypted.');
+ firstFile = CLEAR_MEDIA_1;
+ secondFile = ENCRYPTED_MEDIA_2;
+ break;
+ case CONFIG_CHANGE_TYPE.ENCRYPTED_TO_CLEAR:
+ console.log('Config change type: encrypted to clear.');
+ firstFile = ENCRYPTED_MEDIA_1;
+ secondFile = CLEAR_MEDIA_2;
+ break;
+ case CONFIG_CHANGE_TYPE.ENCRYPTED_TO_ENCRYPTED:
+ console.log('Config change type: encrypted to encrypted.');
+ firstFile = ENCRYPTED_MEDIA_1;
+ secondFile = ENCRYPTED_MEDIA_2;
+ break;
+ }
+ }
+
function appendNextSource(mediaSource) {
console.log('Appending next media source at ' + APPEND_TIME + 'sec.');
var xhr = new XMLHttpRequest();
- var mediaFile =
- (testConfig.runEncrypted == 1) ? ENCRYPTED_MEDIA_2 : CLEAR_MEDIA_2;
- xhr.open("GET", mediaFile);
+ xhr.open("GET", secondFile);
xhr.responseType = 'arraybuffer';
xhr.addEventListener('load', function(e) {
var onUpdateEnd = function(e) {
@@ -121,14 +147,14 @@
function runTest() {
initTestConfig();
- testConfig.mediaFile =
- (testConfig.runEncrypted == 1) ? ENCRYPTED_MEDIA_1 : CLEAR_MEDIA_1;
+ setMediaFiles();
+ testConfig.mediaFile = firstFile;
testConfig.mediaType = mediaType;
video.addEventListener('timeupdate', onTimeUpdate);
video.addEventListener('ended', Utils.failTest);
var mediaSource = MediaSourceUtils.loadMediaSourceFromTestConfig(
testConfig, appendNextSource);
- if (testConfig.runEncrypted == 1) {
+ if (testConfig.configChangeType != CONFIG_CHANGE_TYPE.CLEAR_TO_CLEAR) {
var emePlayer = PlayerUtils.createPlayer(video, testConfig);
emePlayer.registerEventListeners()
.then(function(player) {
« no previous file with comments | « media/test/data/eme_player_js/test_config.js ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698