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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-negative-radius.html

Issue 2670353002: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Addressing comments Created 3 years, 10 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 <!DOCTYPE html> 1 <script src="../../resources/testharness.js"></script>
2 <html> 2 <script src="../../resources/testharnessreport.js"></script>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p> 3 <p id="description"></p>
8 <div id="console"></div> 4 <div id="console"></div>
9 5
10 <script> 6 <script>
11 description("Tests CanvasPathMethods arc and arcTo with negative radii."); 7 test(function(t) {
8 var canvas = document.createElement("canvas");
9 var ctx = canvas.getContext('2d');
12 10
13 var canvas = document.createElement("canvas"); 11 ctx.arc(10, 10, 5, 0, 1, false);
14 var ctx = canvas.getContext('2d'); 12 ctx.arc(10, 10, 0, 0, 1, false);
13 assert_throws(null, function() {ctx.arc(10, 10, -5, 0, 1, false);});
15 14
16 shouldNotThrow("ctx.arc(10, 10, 5, 0, 1, false)"); 15 ctx.arcTo(10, 10, 20, 20, 5);
17 shouldNotThrow("ctx.arc(10, 10, 0, 0, 1, false)"); 16 ctx.arcTo(10, 10, 20, 20, 0);
18 shouldThrow("ctx.arc(10, 10, -5, 0, 1, false)"); 17 assert_throws(null, function() {ctx.arcTo(10, 10, 20, 20, -5);});
19 18
20 shouldNotThrow("ctx.arcTo(10, 10, 20, 20, 5)") 19 var path = new Path2D();
21 shouldNotThrow("ctx.arcTo(10, 10, 20, 20, 0)")
22 shouldThrow("ctx.arcTo(10, 10, 20, 20, -5)")
23 20
24 var path = new Path2D(); 21 path.arc(10, 10, 5, 0, 1, false);
22 path.arc(10, 10, 0, 0, 1, false);
23 assert_throws(null, function() {path.arc(10, 10, -5, 0, 1, false);});
25 24
26 shouldNotThrow("path.arc(10, 10, 5, 0, 1, false)"); 25 path.arcTo(10, 10, 20, 20, 5);
27 shouldNotThrow("path.arc(10, 10, 0, 0, 1, false)"); 26 path.arcTo(10, 10, 20, 20, 0);
28 shouldThrow("path.arc(10, 10, -5, 0, 1, false)"); 27 assert_throws(null, function() {path.arcTo(10, 10, 20, 20, -5);});
29 28 }, 'Tests CanvasPathMethods arc and arcTo with negative radii.');
30 shouldNotThrow("path.arcTo(10, 10, 20, 20, 5)")
31 shouldNotThrow("path.arcTo(10, 10, 20, 20, 0)")
32 shouldThrow("path.arcTo(10, 10, 20, 20, -5)")
33 </script> 29 </script>
34 </body>
35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698