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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/offscreen-canvas/pixel-manipulation/2d.imageData.put.dirty.outside.worker.js

Issue 2553473002: Add offscreen-canvas to the list of wpt directories to skip. (Closed)
Patch Set: Created 4 years 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
(Empty)
1 // DO NOT EDIT! This test has been generated by tools/gentest.py.
2 // OffscreenCanvas test in a worker:2d.imageData.put.dirty.outside
3 // Description:putImageData() handles dirty rectangles outside the canvas correc tly
4 // Note:
5
6 importScripts("/resources/testharness.js");
7 importScripts("/common/canvas-tests.js");
8
9 var t = async_test("putImageData() handles dirty rectangles outside the canvas c orrectly");
10 t.step(function() {
11
12 var offscreenCanvas = new OffscreenCanvas(100, 50);
13 var ctx = offscreenCanvas.getContext('2d');
14
15 ctx.fillStyle = '#f00';
16 ctx.fillRect(0, 0, 100, 50)
17 var imgdata = ctx.getImageData(0, 0, 100, 50);
18 ctx.fillStyle = '#0f0';
19 ctx.fillRect(0, 0, 100, 50)
20 ctx.putImageData(imgdata, 100, 20, 20, 20, -20, -20);
21 ctx.putImageData(imgdata, 200, 200, 0, 0, 100, 50);
22 ctx.putImageData(imgdata, 40, 20, -30, -20, 30, 20);
23 ctx.putImageData(imgdata, -30, 20, 0, 0, 30, 20);
24 _assertPixelApprox(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
25 _assertPixelApprox(offscreenCanvas, 98,15, 0,255,0,255, "98,15", "0,255,0,255", 2);
26 _assertPixelApprox(offscreenCanvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 2);
27 _assertPixelApprox(offscreenCanvas, 98,45, 0,255,0,255, "98,45", "0,255,0,255", 2);
28 _assertPixelApprox(offscreenCanvas, 1,5, 0,255,0,255, "1,5", "0,255,0,255", 2);
29 _assertPixelApprox(offscreenCanvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 2) ;
30 _assertPixelApprox(offscreenCanvas, 1,45, 0,255,0,255, "1,45", "0,255,0,255", 2) ;
31
32 t.done();
33
34 });
35 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698