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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/offscreen-canvas/path-objects/2d.path.isPointInPath.winding.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.path.isPointInPath.winding
3 // Description:isPointInPath() uses the non-zero winding number rule
4 // Note:
5
6 importScripts("/resources/testharness.js");
7 importScripts("/common/canvas-tests.js");
8
9 var t = async_test("isPointInPath() uses the non-zero winding number rule");
10 t.step(function() {
11
12 var offscreenCanvas = new OffscreenCanvas(100, 50);
13 var ctx = offscreenCanvas.getContext('2d');
14
15 // Create a square ring, using opposite windings to make a hole in the centre
16 ctx.moveTo(0, 0);
17 ctx.lineTo(50, 0);
18 ctx.lineTo(50, 50);
19 ctx.lineTo(0, 50);
20 ctx.lineTo(0, 0);
21 ctx.lineTo(10, 10);
22 ctx.lineTo(10, 40);
23 ctx.lineTo(40, 40);
24 ctx.lineTo(40, 10);
25 ctx.lineTo(10, 10);
26 _assertSame(ctx.isPointInPath(5, 5), true, "ctx.isPointInPath(5, 5)", "true");
27 _assertSame(ctx.isPointInPath(25, 5), true, "ctx.isPointInPath(25, 5)", "true");
28 _assertSame(ctx.isPointInPath(45, 5), true, "ctx.isPointInPath(45, 5)", "true");
29 _assertSame(ctx.isPointInPath(5, 25), true, "ctx.isPointInPath(5, 25)", "true");
30 _assertSame(ctx.isPointInPath(25, 25), false, "ctx.isPointInPath(25, 25)", "fals e");
31 _assertSame(ctx.isPointInPath(45, 25), true, "ctx.isPointInPath(45, 25)", "true" );
32 _assertSame(ctx.isPointInPath(5, 45), true, "ctx.isPointInPath(5, 45)", "true");
33 _assertSame(ctx.isPointInPath(25, 45), true, "ctx.isPointInPath(25, 45)", "true" );
34 _assertSame(ctx.isPointInPath(45, 45), true, "ctx.isPointInPath(45, 45)", "true" );
35
36 t.done();
37
38 });
39 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698