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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/offscreen-canvas/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html

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 <!DOCTYPE html>
2 <!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
3 <title>OffscreenCanvas test: 2d.gradient.interpolate.overlap</title>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <script src="/common/canvas-tests.js"></script>
7
8 <h1>2d.gradient.interpolate.overlap</h1>
9 <p class="desc"></p>
10
11
12 <script>
13 var t = async_test("");
14 t.step(function() {
15
16 var offscreenCanvas = new OffscreenCanvas(100, 50);
17 var ctx = offscreenCanvas.getContext('2d');
18
19 offscreenCanvas.width = 200;
20 var g = ctx.createLinearGradient(0, 0, 200, 0);
21 g.addColorStop(0, '#f00');
22 g.addColorStop(0, '#ff0');
23 g.addColorStop(0.25, '#00f');
24 g.addColorStop(0.25, '#0f0');
25 g.addColorStop(0.25, '#0f0');
26 g.addColorStop(0.25, '#0f0');
27 g.addColorStop(0.25, '#ff0');
28 g.addColorStop(0.5, '#00f');
29 g.addColorStop(0.5, '#0f0');
30 g.addColorStop(0.75, '#00f');
31 g.addColorStop(0.75, '#f00');
32 g.addColorStop(0.75, '#ff0');
33 g.addColorStop(0.5, '#0f0');
34 g.addColorStop(0.5, '#0f0');
35 g.addColorStop(0.5, '#ff0');
36 g.addColorStop(1, '#00f');
37 ctx.fillStyle = g;
38 ctx.fillRect(0, 0, 200, 50);
39 _assertPixelApprox(offscreenCanvas, 49,25, 0,0,255,255, "49,25", "0,0,255,255", 16);
40 _assertPixelApprox(offscreenCanvas, 51,25, 255,255,0,255, "51,25", "255,255,0,25 5", 16);
41 _assertPixelApprox(offscreenCanvas, 99,25, 0,0,255,255, "99,25", "0,0,255,255", 16);
42 _assertPixelApprox(offscreenCanvas, 101,25, 255,255,0,255, "101,25", "255,255,0, 255", 16);
43 _assertPixelApprox(offscreenCanvas, 149,25, 0,0,255,255, "149,25", "0,0,255,255" , 16);
44 _assertPixelApprox(offscreenCanvas, 151,25, 255,255,0,255, "151,25", "255,255,0, 255", 16);
45
46 t.done();
47
48 });
49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698