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

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

Issue 2674933002: 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-gradient-without-path.js"></script> 4 <script>
5 test(function(t) {
6 var ctx = document.createElement('canvas').getContext('2d');
7
8 ctx.fillStyle = 'green';
9 ctx.fillRect(0, 0, 100, 100);
10
11 var gradient = ctx.createLinearGradient(0, 0, 0, 100);
12 gradient.addColorStop(1, 'red');
13 ctx.fillStyle = gradient;
14
15 ctx.fill();
16
17 var imageData = ctx.getImageData(1, 1, 98, 98);
18 var imgdata = imageData.data;
19 assert_equals(imgdata[4], 0);
20 assert_equals(imgdata[5], 128);
21 assert_equals(imgdata[6], 0);
22
23 ctx.strokeStyle = 'green';
24 ctx.lineWidth = 100;
25 ctx.strokeRect(50, 0, 100, 100);
26
27 ctx.strokeStyle = gradient;
28
29 ctx.stroke();
30
31 imageData = ctx.getImageData(1, 1, 98, 98);
32 imgdata = imageData.data;
33 assert_equals(imgdata[4], 0);
34 assert_equals(imgdata[5], 128);
35 assert_equals(imgdata[6], 0);
36 }, "Series of tests to ensure that no gradient is drawn without path");
37 </script>
8 </body> 38 </body>
9 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698