| <!DOCTYPE html> |
| <title>HitRegion Exception 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> |
| <script> |
| |
| var canvas = document.querySelector('canvas'); |
| var context = canvas.getContext('2d'); |
| |
| generate_tests(assert_throws, [ |
| [ 'context.addHitRegion()', { name : 'NotSupportedError' }, function() { context.addHitRegion(); } ], |
| [ 'context.addHitRegion({ id : \'\' })', { name : 'NotSupportedError' }, function() { context.addHitRegion({ id : '' }); } ], |
| [ 'context.addHitRegion({ id : undefined })', { name : 'NotSupportedError' }, function() { context.addHitRegion({ id : undefined }); } ], |
| [ 'context.addHitRegion({ control : {} })', { name : 'TypeError' }, function() { context.addHitRegion({ control : {} }); } ], |
| [ 'context.addHitRegion({ control : null })', { name : 'NotSupportedError' }, function() { context.addHitRegion({ control : null }); } ], |
| [ 'context.addHitRegion({ control : undefined })', { name : 'NotSupportedError' }, function() { context.addHitRegion({ control : undefined }); } ], |
| [ 'context.addHitRegion({ id : \'\', control : {} })', { name : 'TypeError' }, function() { context.addHitRegion({ id : '', control : {} }); } ], |
| [ 'context.addHitRegion({ id : undefined, control : {} })', { name : 'TypeError' }, function() { context.addHitRegion({ id : undefined, control : {} }); } ], |
| [ 'context.addHitRegion({ id : \'\', control : null })', { name : 'NotSupportedError' }, function() { context.addHitRegion({ id : '', control : null }); } ], |
| [ 'context.addHitRegion({ id : undefined, control : null })', { name : 'NotSupportedError' }, function() { context.addHitRegion({ id : undefined, control : null }); } ], |
| [ 'context.addHitRegion({ id : \'\', control : undefined })', { name : 'NotSupportedError' }, function() { context.addHitRegion({ id : '', control : undefined }); } ], |
| [ 'context.addHitRegion({ id : undefined, control : undefined )', { name : 'NotSupportedError' }, function() { context.addHitRegion({ id : undefined, control : undefined }); } ], |
| ]); |
| |
| </script> |