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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-path-constructors.html

Issue 2694703004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: 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 PUBLIC "-//IETF//DTD HTML//EN"> 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> 3 <body>
7 <script src="script-tests/canvas-path-constructors.js"></script> 4 <script>
5 test(function(t) {
6 var ctx = document.createElement('canvas').getContext('2d');
7
8 ctx.beginPath();
9 var p1 = new Path2D();
10 p1.rect(0,0,100,100);
11 ctx.fillStyle = 'yellow';
12 ctx.fill(p1);
13 assert_array_equals(ctx.getImageData(1, 0, 1, 1).data, [255, 255, 0, 255]);
14
15 ctx.beginPath();
16 var p2 = new Path2D("M100,0L200,0L200,100L100,100z");
17 ctx.fillStyle = 'blue';
18 ctx.fill(p2);
19 assert_array_equals(ctx.getImageData(101, 0, 1, 1).data, [0, 0, 255, 255]);
20
21 ctx.beginPath();
22 var p3 = new Path2D(p1);
23 ctx.translate(200,0);
24 ctx.fillStyle = 'green';
25 ctx.fill(p3);
26 ctx.translate(-200,0);
27 assert_array_equals(ctx.getImageData(201, 0, 1, 1).data, [0, 128, 0, 255]);
28 }, "Test different constructors of Path.");
29 </script>
8 </body> 30 </body>
9 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698