Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/zero-size-fill-rect.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/zero-size-fill-rect.html b/third_party/WebKit/LayoutTests/fast/canvas/zero-size-fill-rect.html |
| index 44170c930f3114266042c8d5009087f1a4e80830..ee226ef61b0956d55fdf8a30795d565dd470533a 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/canvas/zero-size-fill-rect.html |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/zero-size-fill-rect.html |
| @@ -5,35 +5,24 @@ |
| Fill of a 0-sized rect should not throw an exception, so |
| we expected the output to be a green rect. |
| --> |
| -<html> |
| -<head> |
| -<script type="text/javascript"> |
| -window.onload = function() { |
| - if (window.testRunner) |
| - testRunner.dumpAsText(); |
| - var canvas = document.getElementById("test"); |
| - var context = canvas.getContext("2d"); |
| - context.fillStyle = '#f00'; |
| - context.fillRect(0, 0, canvas.width, canvas.height); |
| - try { |
| +<!DOCTYPE html> |
|
fs
2016/09/08 10:13:10
Move this first in the file. And maybe move the co
Abhishek Kanike
2016/09/14 04:33:57
Done.
|
| +<title>Check Borkedness of canvas fill rect with zero size</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| + |
| +<canvas width="100" height="100"></canvas> |
| +<script> |
| +async_test(function(t) { |
|
fs
2016/09/08 10:13:11
Doesn't look like this test needs to be async (nee
Abhishek Kanike
2016/09/14 04:33:57
Done.
|
| + window.onload = t.step_func_done(function() { |
| + var canvas = document.querySelector('canvas'); |
| + var context = canvas.getContext("2d"); |
| + context.fillStyle = '#f00'; |
| + context.fillRect(0, 0, canvas.width, canvas.height); |
| context.fillRect(0, 0, 0, 0); |
| context.fillRect(0, 0, canvas.width, 0); |
| context.fillRect(0, 0, 0, canvas.height); |
| - } catch (e) { |
| - var node = document.createTextNode("FAIL -- an exception was thrown when drawing a 0 sized rect"); |
| - document.getElementById("body").appendChild(node); |
| - return; |
| - } |
| - context.fillStyle = '#0f0'; |
| - context.fillRect(0, 0, canvas.width, canvas.height); |
| - var node = document.createTextNode("PASS -- 0 sized rects did not trigger an exception"); |
| - document.getElementById("body").appendChild(node); |
| -} |
| + context.fillStyle = '#0f0'; |
| + context.fillRect(0, 0, canvas.width, canvas.height); |
| + }); |
| +}); |
| </script> |
| -<title>borkedness</title> |
| -</head> |
| -<body id="body"> |
| -<canvas id="test" width="100" height="100"></canvas> |
| -<br> |
| -</body> |
| -</html> |