mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
fix the scrolling test in nav core to account for timing expectations in the page
This commit is contained in:
parent
27b228803a
commit
dd75904c11
1 changed files with 13 additions and 10 deletions
|
|
@ -144,34 +144,37 @@
|
|||
|
||||
asyncTest( "page last scroll distance is remembered while navigating to and from pages", function(){
|
||||
$.testHelper.pageSequence([
|
||||
navigateTestRoot,
|
||||
|
||||
function(){
|
||||
$( "body" ).height( $( window ).height() + 500 );
|
||||
$.mobile.changePage( "external.html" );
|
||||
},
|
||||
|
||||
function(){
|
||||
window.scrollTo( 0, 300 );
|
||||
same( $(window).scrollTop(), 300, "scrollTop is 300" );
|
||||
navigateTestRoot();
|
||||
// wait for the initial scroll to 0
|
||||
setTimeout( function() {
|
||||
window.scrollTo( 0, 300 );
|
||||
same( $(window).scrollTop(), 300, "scrollTop is 300 after setting it" );
|
||||
}, 300);
|
||||
|
||||
// wait for the scrollstop to fire and for the scroll to be
|
||||
// recorded 100 ms afterward (see changes made to handle hash
|
||||
// scrolling in some browsers)
|
||||
setTimeout( navigateTestRoot, 500 );
|
||||
},
|
||||
|
||||
function(){
|
||||
window.history.back();
|
||||
history.back();
|
||||
},
|
||||
|
||||
function(){
|
||||
// Give the silentScroll function some time to kick in.
|
||||
setTimeout(function() {
|
||||
same( $(window).scrollTop(), 300, "scrollTop is 300" );
|
||||
same( $(window).scrollTop(), 300, "scrollTop is 300 after returning to the page" );
|
||||
$( "body" ).height( "" );
|
||||
start();
|
||||
}, 100 );
|
||||
}, 300 );
|
||||
}
|
||||
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
asyncTest( "forms with data attribute ajax set to false will not call changePage", function(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue