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

Unified Diff: LayoutTests/fast/canvas/2d.imageDataHD.html

Issue 215193002: Removing webkit-prefixed image data HD APIs from 2D canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: cleaned up obsolete tests Created 6 years, 9 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: LayoutTests/fast/canvas/2d.imageDataHD.html
diff --git a/LayoutTests/fast/canvas/2d.imageDataHD.html b/LayoutTests/fast/canvas/2d.imageDataHD.html
deleted file mode 100644
index 617e71c34ea704193ef4968bbee63d15089f3e6c..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/canvas/2d.imageDataHD.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<pre id="console"></pre>
-<script>
- testRunner.dumpAsText();
-
- function log(message)
- {
- document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
- }
-
- function formatColor(r, g, b, a)
- {
- return "[" + r + ", " + g + ", " + b + ", " + a + "]";
- }
-
- function assertBlack(imageData, i)
- {
- var r = imageData.data[i * 4];
- var g = imageData.data[i * 4 + 1];
- var b = imageData.data[i * 4 + 2];
- var a = imageData.data[i * 4 + 3];
- if (r == 0 && g == 0 && b == 0 && a == 255)
- log("PASS: Pixel " + i + " is black.");
- else
- log("FAIL: Pixel " + i + " is not black: " + formatColor(r, g, b, a) + ".");
- }
-
- function assertGreen(imageData, i)
- {
- var r = imageData.data[i * 4];
- var g = imageData.data[i * 4 + 1];
- var b = imageData.data[i * 4 + 2];
- var a = imageData.data[i * 4 + 3];
- if (r == 0 && g == 255 && b == 0 && a == 255)
- log("PASS: Pixel " + i + " is green.");
- else
- log("FAIL: Pixel " + i + " is not green: " + formatColor(r, g, b, a) + ".");
- }
-
- function assertBlue(imageData, i)
- {
- var r = imageData.data[i * 4];
- var g = imageData.data[i * 4 + 1];
- var b = imageData.data[i * 4 + 2];
- var a = imageData.data[i * 4 + 3];
- if (r == 0 && g == 0 && b == 255 && a == 255)
- log("PASS: Pixel " + i + " is blue.");
- else
- log("FAIL: Pixel " + i + " is not blue: " + formatColor(r, g, b, a) + ".");
- }
-
- if (!window.testRunner)
- log("This test requires WebKitTestRunner or DumpRenderTree.");
-
- testRunner.waitUntilDone();
- testRunner.setBackingScaleFactor(2, function() {
- var canvas = document.createElement("canvas");
- canvas.width = 8;
- canvas.height = 8;
-
- var context = canvas.getContext("2d");
-
- if (context.webkitBackingStorePixelRatio === 2) {
-
- context.fillStyle = "#0f0";
- context.fillRect(0, 0, 4, 8);
- context.fillStyle = "#00f";
- context.fillRect(4, 0, 4, 8);
-
- log("Testing getImageDataHD");
-
- var imageData = context.webkitGetImageDataHD(7, 0, 2, 1);
- assertGreen(imageData, 0);
- assertBlue(imageData, 1);
-
- log("\nTesting putImageDataHD");
-
- context.fillStyle = "#000";
- context.fillRect(0, 0, 8, 8);
-
- imageData = context.createImageData(8, 8);
- for (var i = 0; i < 128; i += 4) {
- imageData.data[i] = 0;
- imageData.data[i + 1] = 255;
- imageData.data[i + 2] = 0;
- imageData.data[i + 3] = 255;
- }
- for (var i = 128; i < 256; i += 4) {
- imageData.data[i] = 0;
- imageData.data[i + 1] = 0;
- imageData.data[i + 2] = 255;
- imageData.data[i + 3] = 255;
- }
-
- context.webkitPutImageDataHD(imageData, 2, 2);
-
- imageData = context.getImageData(2, 0, 1, 1);
- assertBlack(imageData, 0);
-
- imageData = context.getImageData(2, 1, 1, 1);
- assertGreen(imageData, 0);
-
- imageData = context.getImageData(2, 2, 1, 1);
- assertGreen(imageData, 0);
-
- imageData = context.getImageData(2, 3, 1, 1);
- assertBlue(imageData, 0);
-
- imageData = context.getImageData(2, 4, 1, 1);
- assertBlue(imageData, 0);
-
- imageData = context.getImageData(2, 5, 1, 1);
- assertBlack(imageData, 0);
- } else
- log("High-DPI canvas is not enabled.");
-
- testRunner.notifyDone();
- });
-</script>
« no previous file with comments | « LayoutTests/fast/canvas/2d.backingStorePixelRatio-expected.txt ('k') | LayoutTests/fast/canvas/2d.imageDataHD-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698