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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-clip-test.html

Issue 1628413002: asdfsdf Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>HitRegion Clip Test</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="./resources/test-helpers.js"></script>
6 <canvas width="400" height="400"></canvas>
7 <style>
8
9 body {
10 margin : 0px;
11 padding : 0px;
12 }
13
14 </style>
15 <script>
16
17 var canvas = document.querySelector('canvas');
18 var context = canvas.getContext('2d');
19
20 function simple_rect_clip_test(test_set)
21 {
22 context.save();
23 context.beginPath();
24 context.rect(0, 0, 100, 100);
25 context.clip();
26 context.beginPath();
27 context.rect(50, 50, 100, 100);
28 context.fill();
29 context.addHitRegion({ id : 'clip' });
30 context.restore();
31 generate_tests(assert_equals, test_set);
32 }
33
34 function non_rect_clip_test(test_set)
35 {
36 context.save();
37 context.beginPath();
38 context.arc(50, 50, 50, 0, Math.PI * 2);
39 context.clip();
40 context.beginPath();
41 context.rect(0, 0, 100, 100);
42 context.fill();
43 context.addHitRegion({ id : 'clip' });
44 context.restore();
45 generate_tests(assert_equals, test_set);
46 }
47
48 coroutine(function*() {
49 setup({ explicit_done : true, explicit_timeout : true });
50
51 simple_rect_clip_test([
52 [ 'null', yield clickOrTouch(10, 10), null ],
53 [ 'clip', yield clickOrTouch(60, 60), 'clip' ]
54 ]);
55
56 non_rect_clip_test([
57 [ 'null', yield clickOrTouch(0, 0), null ],
58 [ 'null', yield clickOrTouch(100, 0), null ],
59 [ 'null', yield clickOrTouch(100, 100), null ],
60 [ 'null', yield clickOrTouch(0, 100), null ],
61 [ 'clip', yield clickOrTouch(50, 50), 'clip' ]
62 ]);
63
64 done();
65 });
66
67 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698