OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>HitRegion Scale Factor 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.internals) { |
| 37 internals.setPageScaleFactorLimits(2.0, 2.0); |
| 38 internals.setPageScaleFactor(2.0); |
| 39 } |
| 40 |
| 41 generate_tests(assert_equals, [ |
| 42 [ 'devicePixelRatio', devicePixelRatio, 1 ], |
| 43 [ 'face', yield clickOrTouch(200, 200), 'face' ], |
| 44 [ 'nose', yield clickOrTouch(400, 400), 'nose' ], |
| 45 [ 'mouth', yield clickOrTouch(254, 484), 'mouth' ], |
| 46 [ 'eye', yield clickOrTouch(300, 250), 'eye' ], |
| 47 [ 'eye', yield clickOrTouch(500, 250), 'eye' ], |
| 48 [ 'face', yield clickOrTouch(400, 240), 'face' ], |
| 49 [ 'null', yield clickOrTouch(40, 20), null ] |
| 50 ]); |
| 51 |
| 52 done(); |
| 53 }); |
| 54 |
| 55 </script> |
OLD | NEW |