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

Unified Diff: LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html

Issue 1302423004: Support lossy and lossless <canvas>.toDataURL for webp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/canvas-toDataURL-webp.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html
diff --git a/LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html b/LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html
new file mode 100644
index 0000000000000000000000000000000000000000..22094b2c42555e06323877a4f8b9806f26fcc088
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-toBlob-webp-lossless.html
@@ -0,0 +1,39 @@
+<!-- The letters in the right image should be crisp like the letters in the left image. -->
+<canvas></canvas>
+<img id="result" onload="testDone()">
+
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+}
+
+function testDone()
+{
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+var image = new Image();
+image.onload = function() {
+ var canvas = document.querySelector('canvas');
+ canvas.width = image.width;
+ canvas.height = image.height;
+ canvas.getContext('2d').drawImage(image, 0, 0);
+
+ document.body.style.zoom = 1.3;
+
+ canvas.toBlob(function(blob) {
+ var failure = "../../fast/images/resources/rgb-jpeg-red.jpg";
+ if (!blob) {
+ result.src = failure;
+ } else if (blob.type != 'image/webp') {
+ result.src = failure;
+ } else {
+ result.src = URL.createObjectURL(blob);
+ }
+ }, "image/webp.ll", 0.2);
+};
+
+image.src = "resources/letters.png";
+</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/canvas-toDataURL-webp.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698