Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect.html |
| index 7079cedfe7b8f5756d31426adbe772e0ef232bd9..e7cac115733558296fe301c7af9af6f5acc8ba81 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect.html |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-fillRect.html |
| @@ -1,9 +1,49 @@ |
| -<!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.js"></script> |
| +<script> |
| +test(function(t) { |
| + |
| +var ctx = document.createElement('canvas').getContext('2d'); |
|
Justin Novosad
2017/02/06 20:04:23
indent
zakerinasab
2017/02/09 18:02:01
Done.
|
| + |
| +// Fill rect with height = width = 0. |
| +ctx.fillStyle = 'red'; |
| +ctx.fillRect(0, 0, 0, 0); |
| + |
| +var imageData = ctx.getImageData(0, 0, 1, 1); |
| +var imgdata = imageData.data; |
| +assert_equals(imgdata[0], 0); |
| +assert_equals(imgdata[1], 0); |
| +assert_equals(imgdata[2], 0); |
| + |
| +ctx.clearRect(0, 0, 1, 1); |
| + |
| +// Fill rect with height = 0, width = 1. |
| + |
| +ctx.fillStyle = 'red'; |
| +ctx.fillRect(0, 0, 1, 0); |
| + |
| +var imageData = ctx.getImageData(0, 0, 1, 1); |
| +var imgdata = imageData.data; |
| +assert_equals(imgdata[0], 0); |
| +assert_equals(imgdata[1], 0); |
| +assert_equals(imgdata[2], 0); |
| + |
| +ctx.clearRect(0, 0, 1, 1); |
| + |
| +// Fill rect with height = 1, width = 0. |
| + |
| +ctx.fillStyle = 'red'; |
| +ctx.fillRect(0, 0, 0, 1); |
| + |
| +var imageData = ctx.getImageData(0, 0, 1, 1); |
| +var imgdata = imageData.data; |
| +assert_equals(imgdata[0], 0); |
| +assert_equals(imgdata[1], 0); |
| +assert_equals(imgdata[2], 0); |
| + |
| +ctx.clearRect(0, 0, 1, 1); |
| + |
| +}, "Series of tests to ensure correct behavior of canvas.fillRect()."); |
| +</script> |
| </body> |
| -</html> |