Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/idl-callback-function-unittest.html

Issue 2607433002: bindings: Throw a TypeError when a given callback function isn't callable (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/idl-callback-function-unittest.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/idl-callback-function-unittest.html b/third_party/WebKit/LayoutTests/fast/dom/idl-callback-function-unittest.html
index 6626c4b0f9a4f9f74e6c29001808c980b9ed1740..4fb98497323658d36cdc2683ae515f35fcb0c6da 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/idl-callback-function-unittest.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/idl-callback-function-unittest.html
@@ -42,4 +42,16 @@ test(function() {
assert_equals('4', results[1]);
assert_equals('9', results[2]);
}, 'Callback function which takes a number sequence');
+
+test(function() {
+ assert_throws(new TypeError(), function() {
+ callbackFunctionTest.testCallback(null, 'hello', 'world');
+ });
+ assert_throws(new TypeError(), function() {
+ callbackFunctionTest.testCallback({}, 'hello', 'world');
+ });
+ assert_throws(new TypeError(), function() {
+ callbackFunctionTest.testCallback(1, 'hello', 'world');
+ });
+}, 'Passing non-callable values should throw a TypeError');
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698