added test for explicit page caching via data attribute

This commit is contained in:
John Bender 2011-07-26 12:45:58 -07:00
parent 151d55f351
commit 1a95670012
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<div data-nstest-role="page" id="external-test-cached" data-nstest-ajax-dom-caching="true">
</div>
</body>
</html>

View file

@ -44,6 +44,26 @@
]);
});
asyncTest( "external page is cached in the DOM after pagehide", function(){
$.testHelper.pageSequence([
function(){
$.mobile.changePage( "cached-external.html" );
},
// page is pulled and displayed in the dom
function(){
same( $( "#external-test-cached" ).length, 1 );
window.history.back();
},
// external test page is cached in the dom after transitioning away
function(){
same( $( "#external-test-cached" ).length, 1 );
start();
}
]);
});
asyncTest( "forms with data attribute ajax set to false will not call changePage", function(){
var called = false;
var newChangePage = function(){