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

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

Issue 11753017: Fix onKeyAdded check causing flakiness in the tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enabling disabled tests Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/encrypted_media_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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="encrypted_media_utils.js" type="text/javascript"></script> 8 <script src="encrypted_media_utils.js" type="text/javascript"></script>
9 <script type="text/javascript"> 9 <script type="text/javascript">
10 var video = document.querySelector('video'); 10 var video = document.querySelector('video');
11 11
12 function onTimeUpdate() { 12 function onTimeUpdate() {
13 // webkitkeyadded should have been fired before playback. 13 if (video.currentTime < 1)
14 return;
15 // keyadded may be fired around the start of playback; check for it
16 // after a delay to avoid timing issues.
14 if (!video.receivedKeyAdded) 17 if (!video.receivedKeyAdded)
15 failTest('Key added event not received.'); 18 failTest('Key added event not received.');
16 if (video.currentTime < 1)
17 return;
18 if (video.isHeartbeatExpected && !video.receivedHeartbeat) 19 if (video.isHeartbeatExpected && !video.receivedHeartbeat)
19 failTest('Heartbeat keymessage event not received.'); 20 failTest('Heartbeat keymessage event not received.');
20 video.removeEventListener('ended', failTest); 21 video.removeEventListener('ended', failTest);
21 installTitleEventHandler(video, 'ended'); 22 installTitleEventHandler(video, 'ended');
22 video.removeEventListener('timeupdate', onTimeUpdate); 23 video.removeEventListener('timeupdate', onTimeUpdate);
23 } 24 }
24 25
25 // The test completes after playing the encrypted media for 1 second and 26 // The test completes after playing the encrypted media for 1 second and
26 // getting the ended event or when an error occurs at any time. 27 // getting the ended event or when an error occurs at any time.
27 function runTest() { 28 function runTest() {
28 loadEncryptedMediaFromURL(video); 29 loadEncryptedMediaFromURL(video);
29 video.addEventListener('timeupdate', onTimeUpdate); 30 video.addEventListener('timeupdate', onTimeUpdate);
30 video.play(); 31 video.play();
31 } 32 }
32 </script> 33 </script>
33 </body> 34 </body>
34 </html> 35 </html>
OLDNEW
« no previous file with comments | « content/browser/encrypted_media_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698