OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>MediaKeySession lifetime after release()</title> | 4 <title>MediaKeySession lifetime after release()</title> |
5 <script src="encrypted-media-utils.js"></script> | 5 <script src="encrypted-media-utils.js"></script> |
6 <script src="../../resources/testharness.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
7 <script src="../../resources/testharnessreport.js"></script> | 7 <script src="../../resources/testharnessreport.js"></script> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <div id="log"></div> | 10 <div id="log"></div> |
(...skipping 12 matching lines...) Expand all Loading... |
23 var initDataType; | 23 var initDataType; |
24 var initData; | 24 var initData; |
25 var startingActiveDOMObjectCount = window.internals.activeDOMObj
ectCount(document); | 25 var startingActiveDOMObjectCount = window.internals.activeDOMObj
ectCount(document); |
26 | 26 |
27 function numActiveDOMObjectsCreated() | 27 function numActiveDOMObjectsCreated() |
28 { | 28 { |
29 return window.internals.activeDOMObjectCount(document) - sta
rtingActiveDOMObjectCount; | 29 return window.internals.activeDOMObjectCount(document) - sta
rtingActiveDOMObjectCount; |
30 } | 30 } |
31 | 31 |
32 // Create 2 sessions. | 32 // Create 2 sessions. |
33 getSupportedInitDataType().then(function(type) { | 33 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp
leConfiguration()).then(function(access) { |
34 initDataType = type; | 34 initDataType = access.getConfiguration().initDataTypes[0]; |
35 initData = getInitData(initDataType); | 35 initData = getInitData(initDataType); |
36 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); | |
37 }).then(function(access) { | |
38 return access.createMediaKeys(); | 36 return access.createMediaKeys(); |
39 }).then(function(result) { | 37 }).then(function(result) { |
40 mediaKeys = result; | 38 mediaKeys = result; |
41 | 39 |
42 // Verify MediaKeys is an ActiveDOMObject. | 40 // Verify MediaKeys is an ActiveDOMObject. |
43 // In non-Oilpan, numActiveDOMObjectsCreate() == 1. | 41 // In non-Oilpan, numActiveDOMObjectsCreate() == 1. |
44 // In Oilpan, numActiveDOMObjectsCreate() <= 4. | 42 // In Oilpan, numActiveDOMObjectsCreate() <= 4. |
45 // (1 MediaKeys, | 43 // (1 MediaKeys, |
46 // 1 MediaKeysInitializer and | 44 // 1 MediaKeysInitializer and |
47 // 1 MediaKeySystemAccessInitializer (navigator.requestMedi
aKeySystemAccess() use above), | 45 // 1 MediaKeySystemAccessInitializer (navigator.requestMedi
aKeySystemAccess() use above), |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // In non-Oilpan, there is also something from createGCPromi
se(). | 105 // In non-Oilpan, there is also something from createGCPromi
se(). |
108 assert_between_inclusive(numActiveDOMObjectsCreated(), 1, 2,
'mediaKeySession2 not collected'); | 106 assert_between_inclusive(numActiveDOMObjectsCreated(), 1, 2,
'mediaKeySession2 not collected'); |
109 test.done(); | 107 test.done(); |
110 }).catch(function(error) { | 108 }).catch(function(error) { |
111 forceTestFailureFromPromise(test, error); | 109 forceTestFailureFromPromise(test, error); |
112 }); | 110 }); |
113 }, 'MediaKeySession lifetime after release()'); | 111 }, 'MediaKeySession lifetime after release()'); |
114 </script> | 112 </script> |
115 </body> | 113 </body> |
116 </html> | 114 </html> |
OLD | NEW |