Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-playback-encrypted-and-clear-sources.html |
| diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-playback-encrypted-and-clear-sources.html b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-playback-encrypted-and-clear-sources.html |
| index c4686b2c5edc927f0a96c86739b66fe4a9f50abb..f09025a7c36b55222ef71690cd99cf0d860fedb1 100644 |
| --- a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-playback-encrypted-and-clear-sources.html |
| +++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-playback-encrypted-and-clear-sources.html |
| @@ -17,6 +17,10 @@ |
| var encryptedEventCount = 0; |
| var playbackCount = 0; |
| + // Content to be played. These files must be the same format. |
| + var encryptedContent = '../content/test-encrypted.webm'; |
| + var unencryptedContent = '../content/test-vp8-vorbis-webvtt.webm'; |
|
ddorwin
2016/07/20 19:34:20
Any idea why we use this file? It seems we should
|
| + |
| var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b, |
| 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]); |
| @@ -92,18 +96,20 @@ |
| } |
| function startPlayback() { |
| + // Alternate between encrypted and unencrypted files. |
| if (playbackCount % 2) { |
| - video.src = '../content/test-vp8-vorbis-webvtt.webm'; |
| + // Unencrypted files don't require MediaKeys. |
|
ddorwin
2016/07/20 19:34:20
Since we start with clear, we should probably swit
|
| + video.src = unencryptedContent; |
| video.play(); |
| return; |
| } |
| - navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) { |
| + navigator.requestMediaKeySystemAccess('org.w3.clearkey', getConfigurationForFile(encryptedContent)).then(function(access) { |
| return access.createMediaKeys(); |
| }).then(function(mediaKeys) { |
| return video.setMediaKeys(mediaKeys); |
| }).then(function(result) { |
| - video.src = '../content/test-encrypted.webm'; |
| + video.src = encryptedContent; |
| assert_false(video.mediaKeys === null, "video.mediaKeys is null."); |
| video.play(); |
| }).catch(function(error) { |