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

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

Issue 1203693002: Unhide 'window.console' by renaming console variable in layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed nits Created 5 years, 5 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 | « no previous file | LayoutTests/media/video-test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var console = null; 1 var consoleDiv = null;
2 2
3 function consoleWrite(text) 3 function consoleWrite(text)
4 { 4 {
5 if (!console && document.body) { 5 if (!consoleDiv && document.body) {
6 console = document.createElement('div'); 6 consoleDiv = document.createElement('div');
7 document.body.appendChild(console); 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));
11 span.appendChild(document.createElement('br')); 11 span.appendChild(document.createElement('br'));
12 console.appendChild(span); 12 consoleDiv.appendChild(span);
13 } 13 }
14 14
15 // Returns a promise that is fulfilled with true if |initDataType| is supported, 15 // Returns a promise that is fulfilled with true if |initDataType| is supported,
16 // or false if not. 16 // or false if not.
17 function isInitDataTypeSupported(initDataType) 17 function isInitDataTypeSupported(initDataType)
18 { 18 {
19 return navigator.requestMediaKeySystemAccess( 19 return navigator.requestMediaKeySystemAccess(
20 "org.w3.clearkey", [{ initDataTypes : [initDataType] }] ) 20 "org.w3.clearkey", [{ initDataTypes : [initDataType] }] )
21 .then(function() { return(true); }, function() { return(false); }); 21 .then(function() { return(true); }, function() { return(false); });
22 } 22 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(listener);
295 resolve('success'); 295 resolve('success');
296 }); 296 });
297 }); 297 });
298 } 298 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/video-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698