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

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

Issue 2367543004: Extended implementation to use interface as arguments (Closed)
Patch Set: Addressed comments Created 4 years, 2 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();
6
5 test(function() { 7 test(function() {
6 var callbackFunctionTest = internals.callbackFunctionTest();
7 var callback1 = function(msg1, msg2) { 8 var callback1 = function(msg1, msg2) {
8 return msg1 + ', ' + msg2; 9 return msg1 + ', ' + msg2;
9 }; 10 };
10 assert_equals(callbackFunctionTest.testCallback(callback1, 'hello', 'world') , 'SUCCESS: hello, world'); 11 assert_equals(callbackFunctionTest.testCallback(callback1, 'hello', 'world') , 'SUCCESS: hello, world');
11 12
12 var callback2 = function(msg1, msg2) { 13 var callback2 = function(msg1, msg2) {
13 return msg1 + msg1 + ' ' + msg2 + msg2; 14 return msg1 + msg1 + ' ' + msg2 + msg2;
14 }; 15 };
15 assert_equals(callbackFunctionTest.testCallback(callback2, 'hello', 'world') , 'SUCCESS: hellohello worldworld'); 16 assert_equals(callbackFunctionTest.testCallback(callback2, 'hello', 'world') , 'SUCCESS: hellohello worldworld');
16 }, 'Callback function which takes two strings'); 17 }, 'Callback function which takes two strings');
18
19 test(function() {
20 var divElements = document.createElement('div');
bashi 2016/09/23 05:45:18 divElements -> divElement
lkawai 2016/09/23 06:05:36 Done.
21 var addInnerHTML = function(d) {
22 d.innerHTML = 'hello';
23 };
24 callbackFunctionTest.testInterfaceCallback(addInnerHTML, divElements);
25 assert_equals(divElements.innerHTML, 'hello');
26 }, 'Callback function which takes a interface');
17 </script> 27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698