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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-state-intact-after-putImageData.html

Issue 2693193003: 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> 3
4 <script src="../../resources/js-test.js"></script> 4 <script>
5 </head> 5 test(function(t) {
6 <body> 6
7 <script src="script-tests/canvas-state-intact-after-putImageData.js"></script> 7 var ctx = document.createElement('canvas').getContext('2d');
Justin Novosad 2017/02/21 21:53:35 indent
zakerinasab 2017/02/22 15:33:54 Done.
8 </body> 8
9 </html> 9 ctx.fillStyle = 'red';
10 ctx.fillRect(0, 0, 1, 1);
11
12 assert_equals(ctx.fillStyle, '#ff0000');
13 var imageData = ctx.getImageData(0, 0, 2, 1);
14 assert_array_equals(imageData.data.slice(0,4), [255, 0, 0, 255]);
15 assert_array_equals(imageData.data.slice(4), [0, 0, 0, 0]);
16
17 ctx.putImageData(imageData, 1, 1);
18 imageData = ctx.getImageData(1, 1, 1, 1);
19 assert_array_equals(imageData.data, [255, 0, 0, 255]);
20
21 assert_equals(ctx.fillStyle, '#ff0000');
22
23 ctx.fillRect(2, 2, 1, 1);
24 data = ctx.getImageData(2, 2, 1, 1).data;
25 assert_array_equals(data, [255, 0, 0, 255]);
26
27 }, "Test that the rendering context state is intact after a call to putImageData ()");
28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698