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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/DrawImageSinglePixelStretch.html

Issue 2186553003: Update two layout tests to reflect bleeding in ctx.drawImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/canvas/DrawImageSinglePixelStretch.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/DrawImageSinglePixelStretch.html b/third_party/WebKit/LayoutTests/fast/canvas/DrawImageSinglePixelStretch.html
deleted file mode 100644
index 8ce02d3e547226475877597a37c337416723ed27..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/DrawImageSinglePixelStretch.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-
- <head>
- <title>Odd stretching of pixel-wide drawImage call</title>
- <script type="text/javascript" charset="utf-8">
- window.addEventListener('DOMContentLoaded', init, true);
-
- var image, ctx;
-
- function init () {
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
-
- var canvas = document.getElementById("c");
- canvas.width = 200;
- canvas.height = 50;
- ctx = canvas.getContext('2d');
-
- image = new Image();
- image.addEventListener('load', draw, false);
- image.src = 'resources/orangePixels.gif';
- };
-
- function draw () {
- var w = ctx.canvas.width;
- var h = ctx.canvas.height;
- // part between left corner and arrow
- ctx.drawImage(image, 3, 2, 1, 1,
- 0, 0, w, h);
- setTimeout(checkPixels, 0);
- };
-
- function checkPixels() {
- var passed = areAllRowsUniform(ctx);
-
- var result = document.getElementById('result');
- if (passed)
- result.innerHTML = "PASSED";
- else
- result.innerHTML = "FAILED";
-
- if (window.testRunner)
- testRunner.notifyDone();
- }
-
- function areAllRowsUniform(ctx) {
- for (var y = 0; y < ctx.canvas.height; y++) {
- if (!isRowUniform(ctx,y))
- return false;
- }
-
- return true;
- }
-
- function isRowUniform(ctx, y) {
- var start = getPixel(ctx, 0, y);
-
- for (var i = 0; i < ctx.canvas.width; i++) {
- if (!areEqual(start, getPixel(ctx, i, y)))
- return false;
- }
-
- return true;
- };
-
- function areEqual(a, b) {
- return a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3];
- };
-
- function getPixel(ctx, x, y) {
- var idata = ctx.getImageData(x,y,1,1);
- return idata.data;
- };
- </script>
-
- </head>
-
- <body>
- <p>DrawImage with a source of a single pixel should draw one uniform color throughout. Neighboring pixels in the source image shouldn't affect the destination rect's output pixels</p>
- <p>(Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=58267) (Radar: rdar://problem/9148473)</p>
-
- <p> This canvas should be uniformly one color </p>
- <p id="result"></p>
- <canvas id="c"</canvas>
- </body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698