| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test MediaKeySession lifetime without release()</title> | 4 <title>Test MediaKeySession lifetime without 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 13 matching lines...) Expand all Loading... |
| 24 var mediaKeySession3; | 24 var mediaKeySession3; |
| 25 var initDataType; | 25 var initDataType; |
| 26 var initData; | 26 var initData; |
| 27 var startingActiveDOMObjectCount = window.internals.activeDOMObj
ectCount(document); | 27 var startingActiveDOMObjectCount = window.internals.activeDOMObj
ectCount(document); |
| 28 | 28 |
| 29 function numActiveDOMObjectsCreated() | 29 function numActiveDOMObjectsCreated() |
| 30 { | 30 { |
| 31 return window.internals.activeDOMObjectCount(document) - sta
rtingActiveDOMObjectCount; | 31 return window.internals.activeDOMObjectCount(document) - sta
rtingActiveDOMObjectCount; |
| 32 } | 32 } |
| 33 | 33 |
| 34 getSupportedInitDataType().then(function(type) { | 34 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp
leConfiguration()).then(function(access) { |
| 35 initDataType = type; | 35 initDataType = access.getConfiguration().initDataTypes[0]; |
| 36 initData = getInitData(initDataType); | 36 initData = getInitData(initDataType); |
| 37 return navigator.requestMediaKeySystemAccess('org.w3.clearke
y', [{}]); | |
| 38 }).then(function(access) { | |
| 39 assert_equals(access.keySystem, 'org.w3.clearkey'); | |
| 40 return access.createMediaKeys(); | 37 return access.createMediaKeys(); |
| 41 }).then(function(result) { | 38 }).then(function(result) { |
| 42 mediaKeys = result; | 39 mediaKeys = result; |
| 43 assert_equals(typeof mediaKeys.createSession, 'function'); | 40 assert_equals(typeof mediaKeys.createSession, 'function'); |
| 44 | 41 |
| 45 // Verify MediaKeys is an ActiveDOMObject. | 42 // Verify MediaKeys is an ActiveDOMObject. |
| 46 // In non-Oilpan, numActiveDOMObjectsCreate() == 1. | 43 // In non-Oilpan, numActiveDOMObjectsCreate() == 1. |
| 47 // In Oilpan, numActiveDOMObjectsCreate() <= 4. | 44 // In Oilpan, numActiveDOMObjectsCreate() <= 4. |
| 48 // (1 MediaKeys, | 45 // (1 MediaKeys, |
| 49 // 1 MediaKeysInitializer and | 46 // 1 MediaKeysInitializer and |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 assert_between_inclusive(numActiveDOMObjectsCreated(), 0, 1,
'After final gc()'); | 144 assert_between_inclusive(numActiveDOMObjectsCreated(), 0, 1,
'After final gc()'); |
| 148 | 145 |
| 149 test.done(); | 146 test.done(); |
| 150 }).catch(function(error) { | 147 }).catch(function(error) { |
| 151 forceTestFailureFromPromise(test, error); | 148 forceTestFailureFromPromise(test, error); |
| 152 }); | 149 }); |
| 153 }, 'MediaKeySession lifetime without release()'); | 150 }, 'MediaKeySession lifetime without release()'); |
| 154 </script> | 151 </script> |
| 155 </body> | 152 </body> |
| 156 </html> | 153 </html> |
| OLD | NEW |