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

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

Issue 2675763005: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Corrections 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-clearRect.js"></script> 4 <script>
5 test(function(t) {
6 var ctx = document.createElement('canvas').getContext('2d');
7
8 // Clear rect with height = width = 0.
9
10 ctx.fillStyle = 'red';
11 ctx.fillRect(0, 0, 1, 1);
12 ctx.clearRect(0, 0, 0, 0);
13
14 var imageData = ctx.getImageData(0, 0, 1, 1);
15 var imgdata = imageData.data;
16 assert_equals(imgdata[0], 255);
17 assert_equals(imgdata[1], 0);
18 assert_equals(imgdata[2], 0);
19
20 ctx.clearRect(0, 0, 1, 1);
21
22 // Clear rect with height = 0, width = 1.
23
24 ctx.fillStyle = 'red';
25 ctx.fillRect(0, 0, 1, 1);
26 ctx.clearRect(0, 0, 1, 0);
27
28 var imageData = ctx.getImageData(0, 0, 1, 1);
29 var imgdata = imageData.data;
30 assert_equals(imgdata[0], 255);
31 assert_equals(imgdata[1], 0);
32 assert_equals(imgdata[2], 0);
33
34 ctx.clearRect(0, 0, 1, 1);
35
36 // Clear rect with height = 1, width = 0.
37
38 ctx.fillStyle = 'red';
39 ctx.fillRect(0, 0, 1, 1);
40 ctx.clearRect(0, 0, 0, 1);
41
42 var imageData = ctx.getImageData(0, 0, 1, 1);
43 var imgdata = imageData.data;
44 assert_equals(imgdata[0], 255);
45 assert_equals(imgdata[1], 0);
46 assert_equals(imgdata[2], 0);
47
48 ctx.clearRect(0, 0, 1, 1);
49 }, "Series of tests to ensure correct behavior of canvas.clearRect().");
50 </script>
8 </body> 51 </body>
9 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698