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

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

Issue 1463763002: Add event name to bare removeEventListener(listener) calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // Play the specified |content| on |video|. Returns a promise that is resolved 284 // Play the specified |content| on |video|. Returns a promise that is resolved
285 // after the video plays for |duration| seconds. 285 // after the video plays for |duration| seconds.
286 function playVideoAndWaitForTimeupdate(video, content, duration) 286 function playVideoAndWaitForTimeupdate(video, content, duration)
287 { 287 {
288 video.src = content; 288 video.src = content;
289 video.play(); 289 video.play();
290 return new Promise(function(resolve) { 290 return new Promise(function(resolve) {
291 video.addEventListener('timeupdate', function listener(event) { 291 video.addEventListener('timeupdate', function listener(event) {
292 if (event.target.currentTime < duration) 292 if (event.target.currentTime < duration)
293 return; 293 return;
294 video.removeEventListener(listener); 294 video.removeEventListener('timeupdate', listener);
295 resolve('success'); 295 resolve('success');
296 }); 296 });
297 }); 297 });
298 } 298 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698