OLD | NEW |
1 var consoleDiv = null; | 1 var consoleDiv = null; |
2 | 2 |
3 function consoleWrite(text) | 3 function consoleWrite(text) |
4 { | 4 { |
5 if (!consoleDiv && document.body) { | 5 if (!consoleDiv && document.body) { |
6 consoleDiv = document.createElement('div'); | 6 consoleDiv = document.createElement('div'); |
7 document.body.appendChild(consoleDiv); | 7 document.body.appendChild(consoleDiv); |
8 } | 8 } |
9 var span = document.createElement('span'); | 9 var span = document.createElement('span'); |
10 span.appendChild(document.createTextNode(text)); | 10 span.appendChild(document.createTextNode(text)); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 video.play(); | 322 video.play(); |
323 return new Promise(function(resolve) { | 323 return new Promise(function(resolve) { |
324 video.addEventListener('timeupdate', function listener(event) { | 324 video.addEventListener('timeupdate', function listener(event) { |
325 if (event.target.currentTime < duration) | 325 if (event.target.currentTime < duration) |
326 return; | 326 return; |
327 video.removeEventListener('timeupdate', listener); | 327 video.removeEventListener('timeupdate', listener); |
328 resolve('success'); | 328 resolve('success'); |
329 }); | 329 }); |
330 }); | 330 }); |
331 } | 331 } |
| 332 |
| 333 // Verifies that the number of existing MediaKey and MediaKeySession objects |
| 334 // match what is expected. |
| 335 function verifyMediaKeyAndMediaKeySessionCount( |
| 336 expectedMediaKeysCount, expectedMediaKeySessionCount, description) |
| 337 { |
| 338 assert_equals(window.internals.mediaKeysCount(), |
| 339 expectedMediaKeysCount, |
| 340 description + ', MediaKeys:'); |
| 341 assert_equals(window.internals.mediaKeySessionCount(), |
| 342 expectedMediaKeySessionCount, |
| 343 description + ', MediaKeySession:'); |
| 344 } |
OLD | NEW |