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

Side by Side Diff: LayoutTests/fast/canvas/canvas-toDataURL-webp.html

Issue 24438004: Rename testRunner.dumpAsText(true) to testRunner.dumpAsTextWithPixelResults() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: more tests Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 <canvas id="canvas" width="64px" height="64px" style="display: none"></canvas> 1 <canvas id="canvas" width="64px" height="64px" style="display: none"></canvas>
2 <pre id="log"></pre> 2 <pre id="log"></pre>
3 <img id="result"> 3 <img id="result">
4 <script> 4 <script>
5 if (window.testRunner) { 5 if (window.testRunner) {
6 window.testRunner.dumpAsText(pixelTest = true); 6 window.testRunner.dumpAsTextWithPixelResults();
7 window.testRunner.waitUntilDone(); 7 window.testRunner.waitUntilDone();
8 } 8 }
9 9
10 function webpDataURLTest() 10 function webpDataURLTest()
11 { 11 {
12 var canvas = document.getElementById('canvas'); 12 var canvas = document.getElementById('canvas');
13 var context = canvas.getContext('2d'); 13 var context = canvas.getContext('2d');
14 context.drawImage(window.image, 0, 0, canvas.width, canvas.height); 14 context.drawImage(window.image, 0, 0, canvas.width, canvas.height);
15 15
16 var dataURL = canvas.toDataURL('image/webp', 0.8); 16 var dataURL = canvas.toDataURL('image/webp', 0.8);
17 if (!dataURL.match(/^data:image\/webp[;,]/)) 17 if (!dataURL.match(/^data:image\/webp[;,]/))
18 document.getElementById('log').textContent += "FAIL: canvas.toDataURL('i mage/webp') not supported"; 18 document.getElementById('log').textContent += "FAIL: canvas.toDataURL('i mage/webp') not supported";
19 else 19 else
20 document.getElementById('result').src = dataURL; 20 document.getElementById('result').src = dataURL;
21 21
22 if (window.testRunner) 22 if (window.testRunner)
23 window.testRunner.notifyDone(); 23 window.testRunner.notifyDone();
24 } 24 }
25 25
26 var image = new Image(); 26 var image = new Image();
27 image.onload = webpDataURLTest; 27 image.onload = webpDataURLTest;
28 image.src = 'resources/html5.png'; 28 image.src = 'resources/html5.png';
29 </script> 29 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/canvas-text-baseline.html ('k') | LayoutTests/fast/canvas/canvas-transform-identity.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698