mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tests: Solve a frequent race condition in tests in Chrome/Safari
Closes gh-1916
This commit is contained in:
parent
d37ebc624d
commit
579bedd7d2
@ -372,7 +372,8 @@ test("{ placeholder: false }, default", function() {
|
|||||||
QUnit.test( "{ placeholder: false } img", function( assert ) {
|
QUnit.test( "{ placeholder: false } img", function( assert ) {
|
||||||
assert.expect( 3 );
|
assert.expect( 3 );
|
||||||
|
|
||||||
var element = $( "#sortable-images" ).sortable( {
|
var done = assert.async(),
|
||||||
|
element = $( "#sortable-images" ).sortable( {
|
||||||
start: function( event, ui ) {
|
start: function( event, ui ) {
|
||||||
assert.ok( ui.placeholder.attr( "src" ).indexOf( "images/jqueryui_32x32.png" ) > 0, "placeholder img has correct src" );
|
assert.ok( ui.placeholder.attr( "src" ).indexOf( "images/jqueryui_32x32.png" ) > 0, "placeholder img has correct src" );
|
||||||
assert.equal( ui.placeholder.height(), 32, "placeholder has correct height" );
|
assert.equal( ui.placeholder.height(), 32, "placeholder has correct height" );
|
||||||
@ -380,9 +381,14 @@ QUnit.test( "{ placeholder: false } img", function( assert ) {
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
element.find( "img" ).eq( 0 ).simulate( "drag", {
|
// Give browsers some time to load the image if cache is disabled.
|
||||||
dy: 1
|
// This resolves a frequent issue in Chrome/Safari.
|
||||||
} );
|
setTimeout( function() {
|
||||||
|
element.find( "img" ).eq( 0 ).simulate( "drag", {
|
||||||
|
dy: 1
|
||||||
|
} );
|
||||||
|
done();
|
||||||
|
}, 500 );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
QUnit.test( "{ placeholder: String }", function( assert ) {
|
QUnit.test( "{ placeholder: String }", function( assert ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user