OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>HitRegion devicePixelRatio 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 createFace(context); |
| 21 |
| 22 coroutine(function*() { |
| 23 setup({ explicit_done : true, explicit_timeout : true }); |
| 24 |
| 25 generate_tests(assert_equals, [ |
| 26 [ 'devicePixelRatio', devicePixelRatio, 1 ], |
| 27 [ 'face', yield clickOrTouch(100, 100), 'face' ], |
| 28 [ 'nose', yield clickOrTouch(200, 200), 'nose' ], |
| 29 [ 'mouth', yield clickOrTouch(127, 242), 'mouth' ], |
| 30 [ 'eye', yield clickOrTouch(150, 125), 'eye' ], |
| 31 [ 'eye', yield clickOrTouch(250, 125), 'eye' ], |
| 32 [ 'face', yield clickOrTouch(200, 120), 'face' ], |
| 33 [ 'null', yield clickOrTouch(20, 10), null ] |
| 34 ]); |
| 35 |
| 36 if (window.eventSender) |
| 37 eventSender.setPageZoomFactor(2.0); |
| 38 |
| 39 generate_tests(assert_equals, [ |
| 40 [ 'devicePixelRatio', devicePixelRatio, 2 ], |
| 41 [ 'face', yield clickOrTouch(200, 200), 'face' ], |
| 42 [ 'nose', yield clickOrTouch(400, 400), 'nose' ], |
| 43 [ 'mouth', yield clickOrTouch(254, 484), 'mouth' ], |
| 44 [ 'eye', yield clickOrTouch(300, 250), 'eye' ], |
| 45 [ 'eye', yield clickOrTouch(500, 250), 'eye' ], |
| 46 [ 'face', yield clickOrTouch(400, 240), 'face' ], |
| 47 [ 'null', yield clickOrTouch(40, 20), null ] |
| 48 ]); |
| 49 |
| 50 done(); |
| 51 }); |
| 52 |
| 53 </script> |
OLD | NEW |