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

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: 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ctx.fillStyle = 'red';
10 ctx.fillRect(0, 0, 1, 1);
11 ctx.clearRect(0, 0, 0, 0);
12
13 var imageData = ctx.getImageData(0, 0, 1, 1);
14 var imgdata = imageData.data;
15 assert_equals(imgdata[0], 255);
16 assert_equals(imgdata[1], 0);
17 assert_equals(imgdata[2], 0);
18
19 ctx.clearRect(0, 0, 1, 1);
20
21 // Clear rect with height = 0, width = 1.
22 ctx.fillStyle = 'red';
23 ctx.fillRect(0, 0, 1, 1);
24 ctx.clearRect(0, 0, 1, 0);
25
26 var imageData = ctx.getImageData(0, 0, 1, 1);
27 var imgdata = imageData.data;
28 assert_equals(imgdata[0], 255);
29 assert_equals(imgdata[1], 0);
30 assert_equals(imgdata[2], 0);
31
32 ctx.clearRect(0, 0, 1, 1);
33
34 // Clear rect with height = 1, width = 0.
35 ctx.fillStyle = 'red';
36 ctx.fillRect(0, 0, 1, 1);
37 ctx.clearRect(0, 0, 0, 1);
38
39 var imageData = ctx.getImageData(0, 0, 1, 1);
40 var imgdata = imageData.data;
41 assert_equals(imgdata[0], 255);
42 assert_equals(imgdata[1], 0);
43 assert_equals(imgdata[2], 0);
44
45 }, "Series of tests to ensure correct behavior of canvas.clearRect().");
46 </script>
8 </body> 47 </body>
9 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698