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

Side by Side Diff: LayoutTests/media/w3c-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 | « LayoutTests/media/video-test.js ('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 console = null; 1 var consoleDiv = null;
2 function getVideoURI(baseFileName) 2 function getVideoURI(baseFileName)
3 { 3 {
4 var fileExtension = 4 var fileExtension =
5 (document.createElement("video"). 5 (document.createElement("video").
6 canPlayType('video/ogg; codecs="theora"') == "") ? "mp4" : "ogv"; 6 canPlayType('video/ogg; codecs="theora"') == "") ? "mp4" : "ogv";
7 return "./content/" + baseFileName + "." + fileExtension; 7 return "./content/" + baseFileName + "." + fileExtension;
8 } 8 }
9 9
10 function consoleWrite(text) 10 function consoleWrite(text)
11 { 11 {
12 if (!console && document.body) 12 if (!consoleDiv && document.body)
13 { 13 {
14 console = document.createElement('div'); 14 consoleDiv = document.createElement('div');
15 document.body.appendChild(console); 15 document.body.appendChild(consoleDiv);
16 } 16 }
17 var span = document.createElement("span"); 17 var span = document.createElement("span");
18 span.appendChild(document.createTextNode(text)); 18 span.appendChild(document.createTextNode(text));
19 span.appendChild(document.createElement('br')); 19 span.appendChild(document.createElement('br'));
20 console.appendChild(span); 20 consoleDiv.appendChild(span);
21 } 21 }
22 22
23 function waitForEventAndRunStep(eventName, element, func, stepTest) 23 function waitForEventAndRunStep(eventName, element, func, stepTest)
24 { 24 {
25 var eventCallback = function(event) 25 var eventCallback = function(event)
26 { 26 {
27 consoleWrite("EVENT(" + eventName + ")"); 27 consoleWrite("EVENT(" + eventName + ")");
28 if (func) 28 if (func)
29 func(event); 29 func(event);
30 } 30 }
31 if (stepTest) 31 if (stepTest)
32 eventCallback = stepTest.step_func(eventCallback); 32 eventCallback = stepTest.step_func(eventCallback);
33 33
34 element.addEventListener(eventName, eventCallback, true); 34 element.addEventListener(eventName, eventCallback, true);
35 } 35 }
OLDNEW
« no previous file with comments | « LayoutTests/media/video-test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698