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

Side by Side Diff: LayoutTests/media/encrypted-media/encrypted-media-onencrypted.html

Issue 647383002: [Speculative revert to fix browser_tests on Blink canaries.] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>onencrypted</title>
5 <script src="encrypted-media-utils.js"></script>
6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script>
8 </head>
9 <body>
10 <video id="testVideo" controls></video>
11 <div id="log"></div>
12 <p>Test that encrypted event is fired on an encrypted media file.</p>
13 <script>
14 var expectedInitData = stringToUint8Array('0123456789012345');
15
16 // Will get 2 identical events, one for audio, one for video.
17 var expectedEvents = 2;
18
19 async_test(function(test)
20 {
21 var video = document.getElementById('testVideo');
22
23 var onEncrypted = function(event)
24 {
25 assert_equals(event.target, video);
26 assert_true(event instanceof window.MediaEncryptedEvent);
27 assert_equals(event.type, 'encrypted');
28 assert_equals(event.initDataType, 'webm');
29 assert_array_equals(new Uint8Array(event.initData), expected InitData);
30
31 if (--expectedEvents == 0)
32 test.done();
33 };
34
35 waitForEventAndRunStep('encrypted', video, onEncrypted, test);
36 video.src = '../content/test-encrypted.webm';
37 }, 'encrypted fired on encrypted media file.');
38 </script>
39 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698