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

Unified Diff: LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-sessions.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: Changes 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-sessions.html
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-sessions.html b/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-sessions.html
index bcf0fcc04e168371fb2bb5e272b12de9e5e0fa15..e579a1311a15595243d303787343131259be3f78 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-sessions.html
+++ b/LayoutTests/media/encrypted-media/encrypted-media-keystatuses-multiple-sessions.html
@@ -11,6 +11,8 @@
<script>
var mediaKeySession1;
var mediaKeySession2;
+ var initDataType;
+ var initData;
// Even though key ids are uint8, using printable values so that
// they can be verified easily.
@@ -48,8 +50,7 @@
verifyKeyStatuses(mediaKeySession1.keyStatuses, { expected: [key1], unexpected: [key2] });
// Now trigger a message event on session2.
- var initDataType = getInitDataType();
- mediaKeySession2.generateRequest(initDataType, getInitData(initDataType)).catch(function(error) {
+ mediaKeySession2.generateRequest(initDataType, initData).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
}
@@ -87,10 +88,13 @@
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();
mediaKeySession1 = mediaKeys.createSession();
mediaKeySession2 = mediaKeys.createSession();
@@ -105,7 +109,7 @@
waitForEventAndRunStep('keystatuseschange', mediaKeySession2, processKeyStatusesChange2, test);
// Generate a request on session1.
- return mediaKeySession1.generateRequest(initDataType, getInitData(initDataType));
+ return mediaKeySession1.generateRequest(initDataType, initData);
}).catch(function(error) {
forceTestFailureFromPromise(test, error);
});

Powered by Google App Engine
This is Rietveld 408576698