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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/pattern-with-transform.js

Issue 2701053003: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Addressing comments Created 3 years, 10 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/script-tests/pattern-with-transform.js
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/pattern-with-transform.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/pattern-with-transform.js
deleted file mode 100644
index 09291cc9e33ec67faa662c815503c61a013e488f..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/pattern-with-transform.js
+++ /dev/null
@@ -1,55 +0,0 @@
-description("Test for canvas regression where pattern transforms were ignored https://bugs.webkit.org/show_bug.cgi?id=21498");
-
-function pixelValueAt(context, x, y) {
- var imageData = context.getImageData(x, y, 1, 1);
- return imageData.data;
-}
-
-function pixelToString(p) {
- return "[" + p[0] + ", " + p[1] + ", " + p[2] + ", " + p[3] + "]"
-}
-
-function pixelShouldBe(context, x, y, expectedPixelString) {
- var pixel = pixelValueAt(context, x, y);
- var expectedPixel = eval(expectedPixelString);
-
- var pixelString = "pixel " + x + ", " + y;
- if (areArraysEqual(pixel, expectedPixel)) {
- testPassed(pixelString + " is " + pixelToString(pixel));
- } else {
- testFailed(pixelString + " should be " + pixelToString(expectedPixel) + " was " + pixelToString(pixel));
- }
-}
-
-function fillWithColor(context, color) {
- context.save();
- context.fillStyle = color;
- context.fillRect(0, 0, canvas.width, canvas.height);
- context.restore();
-}
-
-var canvas = document.createElement("canvas");
-canvas.height = 100;
-canvas.width = 100;
-canvas.style.height = "100";
-canvas.style.width = "100";
-
-document.body.appendChild(canvas);
-
-var patternImage = document.createElement("canvas");
-patternImage.height = 10;
-patternImage.width = 10;
-var patternImageCtx = patternImage.getContext('2d');
-fillWithColor(patternImageCtx, "green");
-var greenPixel = pixelValueAt(patternImageCtx, 0, 0);
-
-
-var ctx = canvas.getContext('2d');
-var pattern = ctx.createPattern(patternImage, "no-repeat");
-
-fillWithColor(ctx, "blue");
-
-ctx.fillStyle = pattern;
-ctx.translate(20, 20);
-ctx.fillRect(0, 0, 10, 10);
-pixelShouldBe(ctx, 20, 20, "greenPixel");

Powered by Google App Engine
This is Rietveld 408576698