testing additions for listview core

This commit is contained in:
John Bender 2011-07-27 13:41:52 -07:00
parent 180243e9ad
commit ded500f3b4

View file

@ -491,21 +491,44 @@
asyncTest( "nested pages are removed from the dom by default", function(){
var findNestedPages = function(){
return $("#cached-nested-list #topmost").listview('childPages');
return $( "#cached-nested-list #topmost" ).listview( 'childPages' );
};
$.testHelper.pageSequence([
function(){
//reset for relative url refs
$.testHelper.openPage( "#" + location.pathname);
$.testHelper.openPage( "#" + location.pathname );
},
function(){
$.testHelper.openPage("#cache-tests/nested.html");
$.testHelper.openPage( "#cache-tests/nested.html" );
},
function(){
ok(findNestedPages().length > 0, "verify that there are nested pages");
ok( findNestedPages().length > 0, "verify that there are nested pages" );
$.testHelper.openPage( "#" + location.pathname + "cache-tests/clear.html" );
},
function(){
same( findNestedPages().length, 0 );
start();
}
]);
});
asyncTest( "parent page is not removed when visiting a sub page", function(){
$.testHelper.pageSequence([
function(){
//reset for relative url refs
$.testHelper.openPage( "#" + location.pathname );
},
function(){
$.testHelper.openPage( "#cache-tests/nested.html" );
},
function(){
same( ("#cached-nested-list").length, 1 );
$.testHelper.openPage("#" + location.pathname + "cache-tests/clear.html");
},
@ -515,4 +538,5 @@
}
]);
});
})(jQuery);