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..2f488e467859dacde224092c8e8a26d3e097e542 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 |
@@ -1,39 +1,28 @@ |
-<!-- |
+<!DOCTYPE html> |
+<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> |
+/* |
Creates a canvas which is filled red, then attempts to |
fill a number of 0 size rects, finally fills with green. |
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 { |
+*/ |
+async_test(function(t) { |
+ 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> |