Chromium Code Reviews| 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..835f3458f6bbc0fd2b7fba38d4016512408ae46f 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,15 @@ test(function() { |
| }; |
| assert_equals(callbackFunctionTest.testCallback(callback2, 'hello', 'world'), 'SUCCESS: hellohello worldworld'); |
| }, 'Callback function which takes two strings'); |
| + |
| +test(function() { |
| + var div = [document.createElement('div'), document.createElement('div')]; |
|
bashi
2016/09/23 02:16:05
nit: You don't have to use an array. Maybe just fo
lkawai
2016/09/23 02:43:41
I defined testInterfaceCallback using array of int
peria
2016/09/23 02:50:05
+1.
Container is an interface, but its elements ar
peria
2016/09/23 02:50:05
Then I recommend to make two separate tests.
One i
bashi
2016/09/23 02:57:56
This lacks simple use though. You should add follo
lkawai
2016/09/23 05:35:44
Done.
|
| + var getDivElement = function(d) { |
|
peria
2016/09/23 02:50:05
rename this function. it does not meet its behavio
lkawai
2016/09/23 05:35:44
Done.
|
| + d[0].innerHTML = 'hello'; |
|
bashi
2016/09/23 02:16:05
nit: 4-space indent
lkawai
2016/09/23 02:43:41
Done.
|
| + d[1].innerHTML = 'world'; |
| + }; |
| + callbackFunctionTest.testInterfaceCallback(getDivElement, div); |
| + assert_equals(div[0].innerHTML, 'hello'); |
| + assert_equals(div[1].innerHTML, 'world'); |
| +}, 'Callback function which takes a interface'); |
| </script> |