Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(770)

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js

Issue 2618603002: [eme] Convert lifetime tests to promise_tests (Closed)
Patch Set: move to utils Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-multiple-mediakeys.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-lifetime-multiple-mediakeys.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698