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> |