Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-exception-test.html |
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-exception-test.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-exception-test.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..150bb52d26cc8f1898f670495b0d56caab243ab8 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-exception-test.html |
@@ -0,0 +1,27 @@ |
+<!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> |