Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient.html |
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient.html |
index e24d297b3d885d743d87025163b9ebbab638535f..11df69a45efb762c28bc68be25c576d50ad7f80c 100644 |
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient.html |
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect-zeroSizeGradient.html |
@@ -1,9 +1,24 @@ |
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
-<html> |
-<head> |
-<script src="../../resources/js-test.js"></script> |
-</head> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<body> |
-<script src="script-tests/canvas-fillRect-zeroSizeGradient.js"></script> |
+<script> |
+test(function(t) { |
+var ctx = document.createElement('canvas').getContext('2d'); |
Justin Novosad
2017/02/03 18:39:32
indent
zakerinasab
2017/02/09 18:11:03
Done.
|
+ |
+ctx.fillStyle = '#0f0'; |
+ctx.fillRect(0, 0, 1, 1); |
+ |
+var g = ctx.createLinearGradient(0, 0, 0, 0); // zero-length line (undefined direction); |
+g.addColorStop(0, '#f00'); |
+g.addColorStop(1, '#f00'); |
+ctx.fillStyle = g; |
+ctx.fillRect(0, 0, 1 ,1); |
+ |
+var imageData = ctx.getImageData(0, 0, 1, 1); |
+var imgdata = imageData.data; |
+assert_equals(imgdata[0], 0); |
+assert_equals(imgdata[1], 255); |
+assert_equals(imgdata[2], 0); |
+}, "Series of tests to ensure that fillRect() paints nothing on canvas when the fillStyle is set to a zero-size gradient."); |
+</script> |
</body> |
-</html> |