blob: 4dd705f9f4cc6eab02040563370c8a33ac7df857 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<!DOCTYPE html>
<!-- Copyright © 2016 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
<html>
<head>
<title>Test asynchronous creation of MediaKeys and MediaKeySession while running garbage collection</title>
<script src="encrypted-media-utils.js"></script>
<!--
Test requires Chromium specific content and is being disabled.
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
-->
</head>
<body>
<div id="log"></div>
<script>
async_test(function(test)
{
// Run garbage collection often.
setInterval(asyncGC, 0);
var initDataType;
var initData;
var mediaKeySession;
navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimpleConfiguration()).then(function(access) {
initDataType = access.getConfiguration().initDataTypes[0];
initData = getInitData(initDataType);
return access.createMediaKeys();
}).then(function(mediaKeys) {
mediaKeySession = mediaKeys.createSession();
return mediaKeySession.generateRequest(initDataType, initData);
}).then(function() {
return mediaKeySession.close();
}).then(function(result) {
test.done();
}).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
}, 'Test asynchronous creation of MediaKeys and MediaKeySession while running garbage collection.');
</script>
</body>
</html>
|