| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-toDataURL-webp-maximum-quality.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toDataURL-webp-maximum-quality.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toDataURL-webp-maximum-quality.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8b61c2d4776321cbae27ddcdc3a534cf64ff4a0e
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toDataURL-webp-maximum-quality.html
|
| @@ -0,0 +1,32 @@
|
| +<!-- The letters in the right image should be crisp like the letters in the left image. -->
|
| +<canvas></canvas>
|
| +<img id="result">
|
| +<pre id="error"></pre>
|
| +
|
| +<script>
|
| +if (window.testRunner) {
|
| + window.testRunner.dumpAsTextWithPixelResults();
|
| + window.testRunner.waitUntilDone();
|
| +}
|
| +
|
| +var image = new Image();
|
| +
|
| +image.onload = function() {
|
| + var canvas = document.querySelector('canvas');
|
| + canvas.width = this.width;
|
| + canvas.height = this.height;
|
| + canvas.getContext('2d').drawImage(this, 0, 0);
|
| +
|
| + var dataURL = canvas.toDataURL('image/webp', 1.0); // maximum quality
|
| +
|
| + if (!dataURL.match(/^data:image\/webp[;,]/))
|
| + error.textContent += "FAIL: the dataURL should have 'image/webp' type.";
|
| + else
|
| + result.src = dataURL;
|
| +
|
| + if (window.testRunner)
|
| + window.testRunner.notifyDone();
|
| +};
|
| +
|
| +image.src = "resources/letters.png";
|
| +</script>
|
|
|