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

Unified Diff: LayoutTests/media/encrypted-media/encrypted-media-events.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-events.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-events.html b/LayoutTests/media/encrypted-media/encrypted-media-events.html
index acd33dfd05b64c82331d74cdc4afad415d3990b7..23747cb81568c217ccfb00e5315305f637f4f4f9 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-events.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-events.html
@@ -13,6 +13,8 @@
// "keychange" events.
async_test(function(test)
{
+ var initDataType;
+ var initData;
var mediaKeySession;
var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
@@ -42,13 +44,16 @@
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(test.step_func(function(mediaKeys) {
- var initDataType = getInitDataType();
mediaKeySession = mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, test.step_func(processMessage), test);
- return mediaKeySession.generateRequest(initDataType, getInitData(initDataType));
+ return mediaKeySession.generateRequest(initDataType, initData);
})).catch(test.step_func(function(error) {
forceTestFailureFromPromise(test, error);
}));

Powered by Google App Engine
This is Rietveld 408576698