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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-isPointInPath-isPointInStroke.html

Issue 2548003002: Expose isPointInPath and isPointInStroke for OffscreenCanvas 2D (Closed)
Patch Set: update global interface layout tests results 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 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 test(function() {
6 var offscreenCanvas = new OffscreenCanvas(100, 50);
7 var ctx = offscreenCanvas.getContext('2d');
8
9 ctx.rect(0, 0, 20, 20);
10 assert_true(ctx.isPointInPath(10, 10));
11 assert_false(ctx.isPointInPath(30, 10));
12
13 var path = new Path2D();
14 path.rect(20, 20, 100, 100);
15 assert_true(ctx.isPointInPath(path, 20, 20));
16 assert_false(ctx.isPointInPath(path, 130, 20));
17 }, 'Test the behavior of isPointInPath APIs for OffscreenCanvas');
18
19
20 test(function() {
21 var offscreenCanvas = new OffscreenCanvas(100, 50);
22 var ctx = offscreenCanvas.getContext('2d');
23
24 ctx.strokeStyle = '#0f0';
25 ctx.beginPath();
26 ctx.rect(0, 0, 20, 20);
27 assert_true(ctx.isPointInStroke(0, 0));
28 assert_false(ctx.isPointInStroke(30, 10));
29
30 var path = new Path2D();
31 path.rect(20, 20, 100, 100);
32 assert_true(ctx.isPointInStroke(path, 20, 20));
33 assert_true(ctx.isPointInStroke(path, 120, 20));
34 }, 'Test the behavior of isPointInStroke APIs for OffscreenCanvas');
35 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698