4 <title>Test asynchronous creation of MediaKeys and MediaKeySession while running garbage collection
</title>
5 <script src=
"encrypted-media-utils.js"></script>
6 <script src=
"../../resources/testharness.js"></script>
7 <script src=
"../../resources/testharnessreport.js"></script>
12 async_test(function(test
)
14 // Run garbage collection often.
15 setInterval(asyncGC
, 0);
20 getSupportedInitDataType().then(function(type
) {
22 initData
= getInitData(initDataType
);
23 return navigator
.requestMediaKeySystemAccess('org.w3.clearkey', [{}]);
24 }).then(function(access
) {
25 return access
.createMediaKeys();
26 }).then(function(mediaKeys
) {
27 mediaKeySession
= mediaKeys
.createSession();
28 return mediaKeySession
.generateRequest(initDataType
, initData
);
30 return mediaKeySession
.close();
31 }).then(function(result
) {
33 }).catch(function(error
) {
34 forceTestFailureFromPromise(test
, error
);
36 }, 'Test asynchronous creation of MediaKeys and MediaKeySession while running garbage collection.');