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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/set-colors.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/set-colors.js
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/set-colors.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/set-colors.js
deleted file mode 100644
index 4ed54701bd3408794d197b0926ae52128d02929c..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/set-colors.js
+++ /dev/null
@@ -1,112 +0,0 @@
-description("Test of various canvas graphics context calls for setting colors.");
-
-var canvas = document.createElement("canvas");
-var context = canvas.getContext('2d');
-
-function clear()
-{
- context.clearRect(0, 0, canvas.width, canvas.height);
-}
-
-function hex(number)
-{
- var hexDigits = "0123456789abcdef";
- return hexDigits[number >> 4] + hexDigits[number & 0xF];
-}
-
-function pixel()
-{
- var imageData = context.getImageData(0, 0, 1, 1);
- if (imageData.data[3] == 255)
- return "#" + hex(imageData.data[0]) + hex(imageData.data[1]) + hex(imageData.data[2]);
- if (imageData.data[3] == 0)
- return "rgba(" + imageData.data[0] + ", " + imageData.data[1] + ", " + imageData.data[2] + ", 0.0)";
- return "rgba(" + imageData.data[0] + ", " + imageData.data[1] + ", " + imageData.data[2] + ", " + (imageData.data[3] / 255) + ")";
-}
-
-function testFillStyle(string)
-{
- clear();
- context.fillStyle = "black";
- context.fillStyle = string;
- context.fillRect(0, 0, 1, 1);
- return pixel();
-}
-
-function testFillGradient(string)
-{
- clear();
- context.fillStyle = "black";
- var gradient = context.createLinearGradient(0, 0, 1, 1);
- gradient.addColorStop(0, string);
- gradient.addColorStop(1, string);
- context.fillStyle = gradient;
- context.fillRect(0, 0, 1, 1);
- return pixel();
-}
-
-function testStrokeStyle(string)
-{
- clear();
- context.lineWidth = 5;
- context.strokeStyle = "black";
- context.strokeStyle = string;
- context.strokeRect(2, 2, 10, 10);
- return pixel();
-}
-
-function testStrokeGradient(string)
-{
- clear();
- context.lineWidth = 5;
- context.strokeStyle = "black";
- var gradient = context.createLinearGradient(0, 0, 1, 1);
- gradient.addColorStop(0, string);
- gradient.addColorStop(1, string);
- context.strokeStyle = gradient;
- context.strokeRect(2, 2, 10, 10);
- return pixel();
-}
-
-var transparent = "rgba(0, 0, 0, 0.0)";
-var red = "#ff0000";
-var green = "#00ff00";
-var blue = "#0000ff";
-var white = "#ffffff";
-var translucentRed = "rgba(255, 0, 0, 0.8)";
-var translucentGreen = "rgba(0, 255, 0, 0.8)";
-var translucentBlue = "rgba(0, 0, 255, 0.8)";
-var translucentWhite = "rgba(255, 255, 255, 0.8)";
-
-shouldBe("testFillStyle('transparent')", "transparent");
-shouldBe("testFillStyle('blue')", "blue");
-shouldBe("testFillStyle('#FF0000')", "red");
-shouldBe("testFillStyle('#f00')", "red");
-shouldBe("testFillStyle('rgb(255, 0, 0)')", "red");
-shouldBe("testFillStyle('rgba(255, 0, 0, 1)')", "red");
-shouldBe("testFillStyle('rgba(255, 0, 0, 0.8)')", "translucentRed");
-shouldBe("testFillStyle('rgba(255, 0, 0, 0)')", "transparent");
-shouldBe("testFillGradient('transparent')", "transparent");
-shouldBe("testFillGradient('blue')", "blue");
-shouldBe("testFillGradient('#FF0000')", "red");
-shouldBe("testFillGradient('#f00')", "red");
-shouldBe("testFillGradient('rgb(255, 0, 0)')", "red");
-shouldBe("testFillGradient('rgba(255, 0, 0, 1)')", "red");
-shouldBe("testFillGradient('rgba(255, 0, 0, 0.8)')", "translucentRed");
-shouldBe("testFillGradient('rgba(255, 0, 0, 0)')", "transparent");
-shouldBe("testStrokeStyle('transparent')", "transparent");
-shouldBe("testStrokeStyle('blue')", "blue");
-shouldBe("testStrokeStyle('#FF0000')", "red");
-shouldBe("testStrokeStyle('#f00')", "red");
-shouldBe("testStrokeStyle('rgb(255, 0, 0)')", "red");
-shouldBe("testStrokeStyle('rgba(255, 0, 0, 1)')", "red");
-shouldBe("testStrokeStyle('rgba(255, 0, 0, 0.8)')", "translucentRed");
-shouldBe("testStrokeStyle('rgba(255, 0, 0, 0)')", "transparent");
-shouldBe("testStrokeGradient('transparent')", "transparent");
-shouldBe("testStrokeGradient('blue')", "blue");
-shouldBe("testStrokeGradient('#FF0000')", "red");
-shouldBe("testStrokeGradient('#f00')", "red");
-shouldBe("testStrokeGradient('rgb(255, 0, 0)')", "red");
-shouldBe("testStrokeGradient('rgba(255, 0, 0, 1)')", "red");
-shouldBe("testStrokeGradient('rgba(255, 0, 0, 0.8)')", "translucentRed");
-shouldBe("testStrokeGradient('rgba(255, 0, 0, 0)')", "transparent");

Powered by Google App Engine
This is Rietveld 408576698