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

Unified Diff: LayoutTests/media/encrypted-media/encrypted-media-keystatuses.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.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html b/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html
index 1c8493bb78c806b4ff8f885720b4a8afe5d0d281..d8b96b69d31499a529c4d5b238d6ec89e3fbd962 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-keystatuses.html
@@ -9,21 +9,23 @@
<body>
<div id="log"></div>
<script>
- var mediaKeySession;
-
- // Even though key ids are uint8, using printable values so that
- // they can be verified easily.
- var key1String = '123';
- var key2String = '4567890';
- var key1 = stringToUint8Array(key1String);
- var key2 = stringToUint8Array(key2String);
- 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 mediaKeySession;
+ var initDataType;
+ var initData;
+
+ // Even though key ids are uint8, using printable values so that
+ // they can be verified easily.
+ var key1String = '123';
+ var key2String = '4567890';
+ var key1 = stringToUint8Array(key1String);
+ var key2 = stringToUint8Array(key2String);
+ 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.
@@ -98,17 +100,20 @@
test.done();
}
- 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.
assert_equals(mediaKeySession.keyStatuses.size, 0);
waitForEventAndRunStep('message', mediaKeySession, processMessage, 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