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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/zero-size-fill-rect.html

Issue 2311223002: Convert fast/canvas Layouttests to testharness (Closed)
Patch Set: Refactor2 Created 4 years, 3 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/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>

Powered by Google App Engine
This is Rietveld 408576698