OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>HitRegion Exception 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 <script> |
| 8 |
| 9 var canvas = document.querySelector('canvas'); |
| 10 var context = canvas.getContext('2d'); |
| 11 |
| 12 generate_tests(assert_throws, [ |
| 13 [ 'context.addHitRegion()', { name : 'NotSupportedError' }, function() { conte
xt.addHitRegion(); } ], |
| 14 [ 'context.addHitRegion({ id : \'\' })', { name : 'NotSupportedError' }, funct
ion() { context.addHitRegion({ id : '' }); } ], |
| 15 [ 'context.addHitRegion({ id : undefined })', { name : 'NotSupportedError' },
function() { context.addHitRegion({ id : undefined }); } ], |
| 16 [ 'context.addHitRegion({ control : {} })', { name : 'TypeError' }, function()
{ context.addHitRegion({ control : {} }); } ], |
| 17 [ 'context.addHitRegion({ control : null })', { name : 'NotSupportedError' },
function() { context.addHitRegion({ control : null }); } ], |
| 18 [ 'context.addHitRegion({ control : undefined })', { name : 'NotSupportedError
' }, function() { context.addHitRegion({ control : undefined }); } ], |
| 19 [ 'context.addHitRegion({ id : \'\', control : {} })', { name : 'TypeError' },
function() { context.addHitRegion({ id : '', control : {} }); } ], |
| 20 [ 'context.addHitRegion({ id : undefined, control : {} })', { name : 'TypeErro
r' }, function() { context.addHitRegion({ id : undefined, control : {} }); } ], |
| 21 [ 'context.addHitRegion({ id : \'\', control : null })', { name : 'NotSupporte
dError' }, function() { context.addHitRegion({ id : '', control : null }); } ], |
| 22 [ 'context.addHitRegion({ id : undefined, control : null })', { name : 'NotSup
portedError' }, function() { context.addHitRegion({ id : undefined, control : nu
ll }); } ], |
| 23 [ 'context.addHitRegion({ id : \'\', control : undefined })', { name : 'NotSup
portedError' }, function() { context.addHitRegion({ id : '', control : undefined
}); } ], |
| 24 [ 'context.addHitRegion({ id : undefined, control : undefined )', { name : 'No
tSupportedError' }, function() { context.addHitRegion({ id : undefined, control
: undefined }); } ], |
| 25 ]); |
| 26 |
| 27 </script> |
OLD | NEW |