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

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

Issue 2311223002: Convert fast/canvas Layouttests to testharness (Closed)
Patch Set: Convert fast/canvas Layouttests to testharness 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Creates a canvas which is filled red, then attempts to 2 Creates a canvas which is filled red, then attempts to
3 fill a number of 0 size rects, finally fills with green. 3 fill a number of 0 size rects, finally fills with green.
4 4
5 Fill of a 0-sized rect should not throw an exception, so 5 Fill of a 0-sized rect should not throw an exception, so
6 we expected the output to be a green rect. 6 we expected the output to be a green rect.
7 --> 7 -->
8 <html> 8 <!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.
9 <head> 9 <title>Check Borkedness of canvas fill rect with zero size</title>
10 <script type="text/javascript"> 10 <script src="../../resources/testharness.js"></script>
11 window.onload = function() { 11 <script src="../../resources/testharnessreport.js"></script>
12 if (window.testRunner) 12
13 testRunner.dumpAsText(); 13 <canvas width="100" height="100"></canvas>
14 var canvas = document.getElementById("test"); 14 <script>
15 var context = canvas.getContext("2d"); 15 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.
16 context.fillStyle = '#f00'; 16 window.onload = t.step_func_done(function() {
17 context.fillRect(0, 0, canvas.width, canvas.height); 17 var canvas = document.querySelector('canvas');
18 try { 18 var context = canvas.getContext("2d");
19 context.fillStyle = '#f00';
20 context.fillRect(0, 0, canvas.width, canvas.height);
19 context.fillRect(0, 0, 0, 0); 21 context.fillRect(0, 0, 0, 0);
20 context.fillRect(0, 0, canvas.width, 0); 22 context.fillRect(0, 0, canvas.width, 0);
21 context.fillRect(0, 0, 0, canvas.height); 23 context.fillRect(0, 0, 0, canvas.height);
22 } catch (e) { 24 context.fillStyle = '#0f0';
23 var node = document.createTextNode("FAIL -- an exception was thrown when drawing a 0 sized rect"); 25 context.fillRect(0, 0, canvas.width, canvas.height);
24 document.getElementById("body").appendChild(node); 26 });
25 return; 27 });
26 }
27 context.fillStyle = '#0f0';
28 context.fillRect(0, 0, canvas.width, canvas.height);
29 var node = document.createTextNode("PASS -- 0 sized rects did not trigger an exception");
30 document.getElementById("body").appendChild(node);
31 }
32 </script> 28 </script>
33 <title>borkedness</title>
34 </head>
35 <body id="body">
36 <canvas id="test" width="100" height="100"></canvas>
37 <br>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698