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

Unified Diff: LayoutTests/media/encrypted-media/encrypted-media-onencrypted.html

Issue 655603003: Reland: Remove "needkey" event and add its replacement, "encrypted". (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/encrypted-media/encrypted-media-onencrypted.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-needkey.html b/LayoutTests/media/encrypted-media/encrypted-media-onencrypted.html
similarity index 60%
rename from LayoutTests/media/encrypted-media/encrypted-media-needkey.html
rename to LayoutTests/media/encrypted-media/encrypted-media-onencrypted.html
index f4e14554a0a1c9370320a9ee12ef97a751c24987..67577ffa976fd79179dea20da1cf39dd401a3083 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-needkey.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-onencrypted.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>NeedKey</title>
+ <title>onencrypted</title>
<script src="encrypted-media-utils.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
@@ -9,7 +9,7 @@
<body>
<video id="testVideo" controls></video>
<div id="log"></div>
- <p>Test that needkey event is fired on an encrypted media file.</p>
+ <p>Test that encrypted event is fired on an encrypted media file.</p>
<script>
var expectedInitData = stringToUint8Array('0123456789012345');
@@ -20,20 +20,21 @@
{
var video = document.getElementById('testVideo');
- var onNeedKey = function(event)
+ var onEncrypted = function(event)
{
assert_equals(event.target, video);
- assert_true(event instanceof window.MediaKeyNeededEvent);
- assert_equals(event.type, 'needkey');
- assert_array_equals(event.initData, expectedInitData);
+ assert_true(event instanceof window.MediaEncryptedEvent);
+ assert_equals(event.type, 'encrypted');
+ assert_equals(event.initDataType, 'webm');
+ assert_array_equals(new Uint8Array(event.initData), expectedInitData);
if (--expectedEvents == 0)
test.done();
};
- waitForEventAndRunStep('needkey', video, onNeedKey, test);
+ waitForEventAndRunStep('encrypted', video, onEncrypted, test);
video.src = '../content/test-encrypted.webm';
- }, 'Needkey fired on encrypted media file.');
+ }, 'encrypted fired on encrypted media file.');
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698