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

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

Issue 2617653002: bindings: Don't throw a TypeError when 'null' is passed to nullable callback function (Closed)
Patch Set: Created 3 years, 11 months 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 var callbackFunctionTest = internals.callbackFunctionTest(); 5 var callbackFunctionTest = internals.callbackFunctionTest();
6 6
7 test(function() { 7 test(function() {
8 var callback1 = function(msg1, msg2) { 8 var callback1 = function(msg1, msg2) {
9 return msg1 + ', ' + msg2; 9 return msg1 + ', ' + msg2;
10 }; 10 };
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 assert_throws(new TypeError(), function() { 47 assert_throws(new TypeError(), function() {
48 callbackFunctionTest.testCallback(null, 'hello', 'world'); 48 callbackFunctionTest.testCallback(null, 'hello', 'world');
49 }); 49 });
50 assert_throws(new TypeError(), function() { 50 assert_throws(new TypeError(), function() {
51 callbackFunctionTest.testCallback({}, 'hello', 'world'); 51 callbackFunctionTest.testCallback({}, 'hello', 'world');
52 }); 52 });
53 assert_throws(new TypeError(), function() { 53 assert_throws(new TypeError(), function() {
54 callbackFunctionTest.testCallback(1, 'hello', 'world'); 54 callbackFunctionTest.testCallback(1, 'hello', 'world');
55 }); 55 });
56 }, 'Passing non-callable values should throw a TypeError'); 56 }, 'Passing non-callable values should throw a TypeError');
57
58 test(function() {
59 assert_equals(callbackFunctionTest.testNullableCallback(null, 'hello', 'world' ), 'Empty callback');
60 }, 'Passing null to nullable callback argument');
57 </script> 61 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698