34 lines
1.1 KiB
HTML
34 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="../../resources/testharness.js"></script>
|
|
<script src="../../resources/testharnessreport.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
var canvas = document.createElement('canvas');
|
|
var context = canvas.getContext('2d');
|
|
|
|
test(function() {
|
|
try {
|
|
context.isPointInPath(1);
|
|
} catch (e) {
|
|
assert_true(e instanceof TypeError);
|
|
assert_equals(e.name, "TypeError");
|
|
assert_equals(e.message, "Not enough arguments");
|
|
}
|
|
}, "An overloaded function that is passed too few arguments for any overload should throw a 'Not enough arguments' exception");
|
|
|
|
test(function() {
|
|
try {
|
|
context.isPointInPath.call({ }, 1);
|
|
} catch (e) {
|
|
assert_true(e instanceof TypeError);
|
|
assert_equals(e.name, "TypeError");
|
|
assert_equals(e.message, "Can only call CanvasRenderingContext2D.isPointInPath on instances of CanvasRenderingContext2D");
|
|
}
|
|
}, "An overloaded function that is passed too few arguments for any overload, and also an invalid this object, should throw an 'Invalid this object' exception");
|
|
</script>
|
|
</body>
|
|
</html>
|