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

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

Issue 2690183006: 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/canvas-strokePath-shadow.js
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-strokePath-shadow.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-strokePath-shadow.js
deleted file mode 100644
index 01f43c173a654435f5036d1feff69f9e01f490e1..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-strokePath-shadow.js
+++ /dev/null
@@ -1,105 +0,0 @@
-description("Ensure correct behavior of canvas with path stroke shadow");
-
-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);
-}
-
-// Level of tolerance we expect of most pixel comparisons in this test.
-function shouldBeAlmost(_a, _b)
-{
- shouldBeCloseTo(_a, _b, 2);
-}
-
-var canvas = document.createElement('canvas');
-document.body.appendChild(canvas);
-canvas.setAttribute('width', '700');
-canvas.setAttribute('height', '700');
-var ctx = canvas.getContext('2d');
-
-ctx.beginPath();
-ctx.moveTo(300, 300);
-ctx.lineTo(300, 50);
-ctx.bezierCurveTo(200, 40, 75, 150, 30, 30);
-ctx.quadraticCurveTo(250, 75, 50, 300);
-ctx.shadowOffsetX = 350;
-ctx.shadowColor = 'rgba(255, 20, 0, 0.5)';
-ctx.shadowBlur = 0;
-ctx.strokeStyle = 'rgba(0, 0, 255, 1)';
-ctx.lineWidth = 30;
-ctx.closePath();
-ctx.stroke();
-
-ctx.beginPath();
-ctx.moveTo(300,650);
-ctx.lineTo(300,400);
-ctx.bezierCurveTo(200, 390, 75, 500, 30, 380);
-ctx.quadraticCurveTo(250, 425, 50, 650);
-ctx.shadowOffsetX = 350;
-ctx.shadowColor = 'rgba(255, 0, 0, 0.5)';
-ctx.shadowBlur = 30;
-ctx.strokeStyle = 'rgba(0, 0, 255, 1)';
-ctx.lineWidth = 30;
-ctx.closePath();
-ctx.stroke();
-
-var imageData, data;
-
-// Verify solid shadow.
-imageData = ctx.getImageData(650, 300, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 20);
-shouldBeAlmost('data[2]', 0);
-
-imageData = ctx.getImageData(650, 50, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 20);
-shouldBeAlmost('data[2]', 0);
-
-imageData = ctx.getImageData(380, 30, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 20);
-shouldBeAlmost('data[2]', 0);
-
-imageData = ctx.getImageData(400, 40, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 20);
-shouldBeAlmost('data[2]', 0);
-
-// Verify blurry shadow.
-imageData = ctx.getImageData(640, 640, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 0);
-shouldBeAlmost('data[2]', 0);
-shouldNotBe('data[3]', '255');
-
-imageData = ctx.getImageData(650, 400, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 0);
-shouldBeAlmost('data[2]', 0);
-shouldNotBe('data[3]', '255');
-
-imageData = ctx.getImageData(380, 380, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 0);
-shouldBeAlmost('data[2]', 0);
-shouldNotBe('data[3]', '255');
-
-imageData = ctx.getImageData(350, 380, 1, 1);
-data = imageData.data;
-shouldBeAlmost('data[0]', 255);
-shouldBeAlmost('data[1]', 0);
-shouldBeAlmost('data[2]', 0);
-shouldNotBe('data[3]', '255');

Powered by Google App Engine
This is Rietveld 408576698