| 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 f8ff7e029adb70b8f7eb085f008685e54ccfdf7b..2d31ad6c9e579c1c4d3efcec382b2dee8330952c 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
|
| @@ -2,8 +2,9 @@
|
| <script src="../../resources/testharness.js"></script>
|
| <script src="../../resources/testharnessreport.js"></script>
|
| <script>
|
| +var callbackFunctionTest = internals.callbackFunctionTest();
|
| +
|
| test(function() {
|
| - var callbackFunctionTest = internals.callbackFunctionTest();
|
| var callback1 = function(msg1, msg2) {
|
| return msg1 + ', ' + msg2;
|
| };
|
| @@ -14,4 +15,23 @@ test(function() {
|
| };
|
| assert_equals(callbackFunctionTest.testCallback(callback2, 'hello', 'world'), 'SUCCESS: hellohello worldworld');
|
| }, 'Callback function which takes two strings');
|
| +
|
| +test(function() {
|
| + var squareStringNumbers = function(numbers) {
|
| + return numbers.map(n => (n * n).toString());
|
| + };
|
| + var results = callbackFunctionTest.testSequenceCallback(squareStringNumbers, [1, 2, 3]);
|
| + assert_equals(3, results.length);
|
| + assert_equals('1', results[0]);
|
| + assert_equals('4', results[1]);
|
| + assert_equals('9', results[2]);
|
| +
|
| + var exception = new TypeError();
|
| + assert_throws(exception, function() {
|
| + var throwException = function() {
|
| + throw exception;
|
| + };
|
| + callbackFunctionTest.testSequenceCallback(throwException, [1, 2, 3]);
|
| + });
|
| +}, 'Callback function which takes a number sequence');
|
| </script>
|
|
|