diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 0b272a0d5..0510da4b4 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -1041,19 +1041,21 @@ test( "redefine", function() { }); asyncTest( "_delay", function() { - expect( 4 ); + expect( 6 ); var order = 0, that; $.widget( "ui.testWidget", { defaultElement: null, _create: function() { that = this; - this._delay(function() { + var timer = this._delay(function() { strictEqual( this, that ); equal( order, 1 ); start(); }, 500); - this._delay("callback"); + ok( timer !== undefined ); + timer = this._delay("callback"); + ok( timer !== undefined ); }, callback: function() { strictEqual( this, that ); diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 55b6eda5d..31328a455 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -339,7 +339,7 @@ $.Widget.prototype = { .apply( instance, arguments ); } var instance = this; - setTimeout( handlerProxy, delay || 0 ); + return setTimeout( handlerProxy, delay || 0 ); }, _hoverable: function( element ) {