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

Side by Side Diff: chrome/test/data/media/encrypted_media_player.html

Issue 182113005: Update EME browser tests to include EME WD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename tests Created 6 years, 9 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Encrypted Media Player</title> 4 <title>Encrypted Media Player</title>
5 </head> 5 </head>
6 <body onload="runTest();"> 6 <body onload="runTest();">
7 <video controls></video> 7 <video controls></video>
8 <script src="media_utils.js" type="text/javascript"></script> 8 <script src="media_utils.js" type="text/javascript"></script>
9 <script src="media_source_utils.js" type="text/javascript"></script> 9 <script src="media_source_utils.js" type="text/javascript"></script>
10 <script src="encrypted_media_utils.js" type="text/javascript"></script> 10 <script src="encrypted_media_utils.js" type="text/javascript"></script>
11 <script type="text/javascript"> 11 <script type="text/javascript">
12 var video = document.querySelector('video'); 12 var video = document.querySelector('video');
13 13
14 function onTimeUpdate() { 14 function onTimeUpdate() {
15 if (video.currentTime < 1) 15 if (video.currentTime < 1)
16 return; 16 return;
17 // For loadSession() tests, addKey() will not be called after 17 // For loadSession() tests, addKey() will not be called after
18 // loadSession() (the key is loaded internally). Do not check keyadded 18 // loadSession() (the key is loaded internally). Do not check keyadded
19 // and heartbeat for these tests. 19 // and heartbeat for these tests.
20 if (!sessionToLoad) { 20 if (!sessionToLoad) {
21 // keyadded may be fired around the start of playback; check for it 21 // keyadded may be fired around the start of playback; check for it
22 // after a delay to avoid timing issues. 22 // after a delay to avoid timing issues.
23 if (!video.receivedKeyAdded) 23 if (usePrefixedEME && !video.receivedKeyAdded)
24 failTest('Key added event not received.'); 24 failTest('Key added event not received.');
25 if (video.isHeartbeatExpected && !video.receivedHeartbeat) 25 if (video.isHeartbeatExpected && !video.receivedHeartbeat)
26 failTest('Heartbeat keymessage event not received.'); 26 failTest('Heartbeat keymessage event not received.');
27 } 27 }
28 video.removeEventListener('ended', failTest); 28 video.removeEventListener('ended', failTest);
29 installTitleEventHandler(video, 'ended'); 29 installTitleEventHandler(video, 'ended');
30 video.removeEventListener('timeupdate', onTimeUpdate); 30 video.removeEventListener('timeupdate', onTimeUpdate);
31 } 31 }
32 32
33 // The test completes after playing the encrypted media for 1 second and 33 // The test completes after playing the encrypted media for 1 second and
34 // getting the ended event or when an error occurs at any time. 34 // getting the ended event or when an error occurs at any time.
35 function runTest() { 35 function runTest() {
36 loadEncryptedMediaFromURL(video); 36 loadEncryptedMediaFromURL(video);
37 video.addEventListener('timeupdate', onTimeUpdate); 37 video.addEventListener('timeupdate', onTimeUpdate);
38 video.play(); 38 video.play();
39 } 39 }
40 </script> 40 </script>
41 </body> 41 </body>
42 </html> 42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698