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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-scale-fillPath-shadow.js

Issue 2696023002: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Rebaseline 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/canvas-scale-fillPath-shadow.js
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-scale-fillPath-shadow.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-scale-fillPath-shadow.js
deleted file mode 100644
index 98675134edbf664eefabee248511b79cac5b3500..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-scale-fillPath-shadow.js
+++ /dev/null
@@ -1,148 +0,0 @@
-description("Ensure correct behavior of canvas with path fill + shadow after scaling. A blue and red checkered pattern should be displayed.");
-
-function print(message, color)
-{
- var paragraph = document.createElement("div");
- paragraph.appendChild(document.createTextNode(message));
- paragraph.style.fontFamily = "monospace";
- if (color)
- paragraph.style.color = color;
- document.getElementById("console").appendChild(paragraph);
-}
-
-function shouldBeAround(a, b)
-{
- var evalA;
- try {
- evalA = eval(a);
- } catch(e) {
- evalA = e;
- }
-
- if (Math.abs(evalA - b) < 20)
- print("PASS " + a + " is around " + b , "green")
- else
- print("FAIL " + a + " is not around " + b + " (actual: " + evalA + ")", "red");
-}
-
-var canvas = document.createElement('canvas');
-document.body.appendChild(canvas);
-canvas.setAttribute('width', '1000');
-canvas.setAttribute('height', '1000');
-var ctx = canvas.getContext('2d');
-
-ctx.scale(2, 2);
-ctx.shadowOffsetX = 100;
-ctx.shadowOffsetY = 100;
-ctx.fillStyle = 'rgba(0, 0, 255, 1)';
-
-ctx.shadowColor = 'rgba(255, 0, 0, 1.0)';
-ctx.beginPath();
-ctx.moveTo(50, 50);
-ctx.lineTo(100, 50);
-ctx.lineTo(100, 100);
-ctx.lineTo(50, 100);
-ctx.fill();
-
-ctx.shadowColor = 'rgba(255, 0, 0, 0.3)';
-ctx.beginPath();
-ctx.moveTo(50, 150);
-ctx.lineTo(100, 150);
-ctx.lineTo(100, 200);
-ctx.lineTo(50, 200);
-ctx.fill();
-
-ctx.shadowColor = 'rgba(255, 0, 0, 1.0)';
-ctx.shadowBlur = 10;
-ctx.beginPath();
-ctx.moveTo(150, 50);
-ctx.lineTo(200, 50);
-ctx.lineTo(200, 100);
-ctx.lineTo(150, 100);
-ctx.fill();
-
-ctx.shadowColor = 'rgba(255, 0, 0, 0.3)';
-ctx.beginPath();
-ctx.moveTo(150, 150);
-ctx.lineTo(200, 150);
-ctx.lineTo(200, 200);
-ctx.lineTo(150, 200);
-ctx.fill();
-
-var d; // imageData.data
-
-// Verify solid shadow.
-d = ctx.getImageData(201, 205, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBe('d[3]', '255');
-
-d = ctx.getImageData(298, 295, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBe('d[3]', '255');
-
-d = ctx.getImageData(201, 298, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBe('d[3]', '255');
-
-// Verify solid alpha shadow.
-d = ctx.getImageData(201, 405, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '76');
-
-d = ctx.getImageData(298, 405, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '76');
-
-d = ctx.getImageData(205, 498, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '76');
-
-// Verify blurry shadow.
-d = ctx.getImageData(398, 205, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '83');
-
-d = ctx.getImageData(501, 205, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '83');
-
-d = ctx.getImageData(500, 300, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '53');
-
-// Verify blurry alpha shadow.
-d = ctx.getImageData(398, 405, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '24');
-
-d = ctx.getImageData(405, 501, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '24');
-
-d = ctx.getImageData(405, 501, 1, 1).data;
-shouldBe('d[0]', '255');
-shouldBe('d[1]', '0');
-shouldBe('d[2]', '0');
-shouldBeAround('d[3]', '24');

Powered by Google App Engine
This is Rietveld 408576698