summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-basic-test.html
blob: 873fa027b86af31e826b7e5657e32eeb08fe76e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<title>HitRegion Basic Test</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="./resources/test-helpers.js"></script>
<canvas width="400" height="400"></canvas>
<style>

body {
  margin : 0px;
  padding : 0px;
}

</style>
<script>

var canvas = document.querySelector('canvas');
var context = canvas.getContext('2d');

createFace(context);

coroutine(function*() {
  setup({ explicit_done : true, explicit_timeout : true });

  generate_tests(assert_equals, [
    [ 'face', yield clickOrTouch(100, 100), 'face' ],
    [ 'nose', yield clickOrTouch(200, 200), 'nose' ],
    [ 'mouth', yield clickOrTouch(127, 242), 'mouth' ],
    [ 'eye', yield clickOrTouch(150, 125), 'eye' ],
    [ 'eye', yield clickOrTouch(250, 125), 'eye' ],
    [ 'face', yield clickOrTouch(200, 120), 'face' ],
    [ 'null', yield clickOrTouch(20, 10), null ]
  ]);

  done();
});

</script>