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

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

Issue 2311223002: Convert fast/canvas Layouttests to testharness (Closed)
Patch Set: 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..729d939a815581a8a94802a4f3d66e53f16008af 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,32 +5,28 @@
Fill of a 0-sized rect should not throw an exception, so
we expected the output to be a green rect.
-->
+<!DOCTYPE html>
<html>
sivag 2016/09/06 12:58:44 remove html, head not needed.
Abhishek Kanike 2016/09/08 09:05:07 Done.
<head>
+<title>Check Borkedness of canvas fill rect with zero size</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
<script type="text/javascript">
Srirama 2016/09/06 13:27:20 remove type attribute.
Abhishek Kanike 2016/09/08 09:05:07 Done.
-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.getElementById("test");
sivag 2016/09/06 12:58:44 document.queryselector('canvas')
Abhishek Kanike 2016/09/08 09:05:07 Done.
+ 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>
sivag 2016/09/06 12:58:44 remove head, body, br, html tags. move canvas tag
Abhishek Kanike 2016/09/08 09:05:08 Done.
<body id="body">
<canvas id="test" width="100" height="100"></canvas>

Powered by Google App Engine
This is Rietveld 408576698