diff options
Diffstat (limited to 'tests/unit/tooltip')
-rw-r--r-- | tests/unit/tooltip/all.html | 2 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_core.js | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/unit/tooltip/all.html b/tests/unit/tooltip/all.html index 6329326b9..cb1c14095 100644 --- a/tests/unit/tooltip/all.html +++ b/tests/unit/tooltip/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Tooltip Test Suite</title> - <script src="../../../jquery-1.8.2.js"></script> + <script src="../../../jquery-1.8.3.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index 69936dba2..c3568bffc 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -107,4 +107,31 @@ test( "tooltip on .ui-state-disabled element", function() { equal( $( ".ui-tooltip" ).length, 0 ); }); +// http://bugs.jqueryui.com/ticket/8740 +asyncTest( "programmatic focus with async content", function() { + expect( 2 ); + var element = $( "#tooltipped1" ).tooltip({ + content: function( response ) { + setTimeout(function() { + response( "test" ); + }); + } + }); + + element.bind( "tooltipopen", function( event ) { + deepEqual( event.originalEvent.type, "focusin" ); + + element.bind( "tooltipclose", function( event ) { + deepEqual( event.originalEvent.type, "focusout" ); + start(); + }); + + setTimeout(function() { + element.blur(); + }); + }); + + element.focus(); +}); + }( jQuery ) ); |