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

Side by Side Diff: media/test/data/eme_player_js/player_utils.js

Issue 1717033002: EME: Fix the CDM File IO test when run using unprefixed EME. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The PlayerUtils provides utility functions to binding common media events 5 // The PlayerUtils provides utility functions to binding common media events
6 // to specific player functions. It also provides functions to load media source 6 // to specific player functions. It also provides functions to load media source
7 // base on test configurations. 7 // base on test configurations.
8 var PlayerUtils = new function() { 8 var PlayerUtils = new function() {
9 } 9 }
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 } catch (e) { 92 } catch (e) {
93 Utils.failTest(e); 93 Utils.failTest(e);
94 } 94 }
95 }); 95 });
96 96
97 this.registerDefaultEventListeners(player); 97 this.registerDefaultEventListeners(player);
98 player.video.receivedKeyMessage = false; 98 player.video.receivedKeyMessage = false;
99 Utils.timeLog('Setting video media keys: ' + player.testConfig.keySystem); 99 Utils.timeLog('Setting video media keys: ' + player.testConfig.keySystem);
100 var config = {}; 100 var config = {};
101 // The File IO test requires persistent state support.
102 if (player.testConfig.keySystem ==
103 'org.chromium.externalclearkey.fileiotest') {
104 config = {persistentState: "required"};
105 }
101 if (player.testConfig.sessionToLoad) { 106 if (player.testConfig.sessionToLoad) {
102 config = { 107 config = {
103 persistentState: "required", 108 persistentState: "required",
104 sessionTypes: ["temporary", "persistent-license"] 109 sessionTypes: ["temporary", "persistent-license"]
105 }; 110 };
106 } 111 }
107 return navigator.requestMediaKeySystemAccess( 112 return navigator.requestMediaKeySystemAccess(
108 player.testConfig.keySystem, [config]) 113 player.testConfig.keySystem, [config])
109 .then(function(access) { return access.createMediaKeys(); }) 114 .then(function(access) { return access.createMediaKeys(); })
110 .then(function(mediaKeys) { 115 .then(function(mediaKeys) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 default: 221 default:
217 Utils.timeLog(keySystem + ' is not a known key system'); 222 Utils.timeLog(keySystem + ' is not a known key system');
218 if (usePrefixedEME) 223 if (usePrefixedEME)
219 return PrefixedClearKeyPlayer; 224 return PrefixedClearKeyPlayer;
220 return ClearKeyPlayer; 225 return ClearKeyPlayer;
221 } 226 }
222 } 227 }
223 var Player = getPlayerType(testConfig.keySystem); 228 var Player = getPlayerType(testConfig.keySystem);
224 return new Player(video, testConfig); 229 return new Player(video, testConfig);
225 }; 230 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698