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

Unified Diff: LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-updates.html

Issue 1004843003: Use requestMediaKeySystemAccess() to check type support in EME layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move vars Created 5 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-updates.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-updates.html b/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-updates.html
index 45a25ab230e45a1525e05b20ff5ccd3ef6c6507d..e29c5ab957947ee7a10e1d416e2a3e5a466d8eda 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-updates.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-updates.html
@@ -9,20 +9,22 @@
<body>
<div id="log"></div>
<script>
- var mediaKeySession;
- var firstEvent;
-
- // Even though key ids are uint8, using printable values so that
- // they can be verified easily.
- var key1 = stringToUint8Array('123');
- var key2 = stringToUint8Array('4567890');
- var rawKey1 = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
- 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
- var rawKey2 = new Uint8Array([0x3c, 0xae, 0xe4, 0xfc, 0x2a, 0x12, 0xef, 0x68,
- 0x7b, 0xd2, 0x14, 0x68, 0xf1, 0x62, 0xdd, 0xeb]);
-
async_test(function(test)
{
+ var initDataType;
+ var initData;
+ var mediaKeySession;
+ var firstEvent;
+
+ // Even though key ids are uint8, using printable values so that
+ // they can be verified easily.
+ var key1 = stringToUint8Array('123');
+ var key2 = stringToUint8Array('4567890');
+ var rawKey1 = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
+ 0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
+ var rawKey2 = new Uint8Array([0x3c, 0xae, 0xe4, 0xfc, 0x2a, 0x12, 0xef, 0x68,
+ 0x7b, 0xd2, 0x14, 0x68, 0xf1, 0x62, 0xdd, 0xeb]);
+
function processMessage(event)
{
// No keys added yet.
@@ -58,10 +60,13 @@
}
}
- navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) {
+ getSupportedInitDataType().then(function(type) {
+ initDataType = type;
+ initData = getInitData(initDataType);
+ return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]);
+ }).then(function(access) {
return access.createMediaKeys();
}).then(function(mediaKeys) {
- var initDataType = getInitDataType();
mediaKeySession = mediaKeys.createSession();
// There should be no keys defined yet.
@@ -70,7 +75,7 @@
waitForEventAndRunStep('message', mediaKeySession, processMessage, test);
waitForEventAndRunStep('keystatuseschange', mediaKeySession, processKeyStatusesChange, test);
- return mediaKeySession.generateRequest(initDataType, getInitData(initDataType));
+ return mediaKeySession.generateRequest(initDataType, initData);
}).catch(function(error) {
forceTestFailureFromPromise(test, error);
});

Powered by Google App Engine
This is Rietveld 408576698