From 1a956700125ad45508c6613e56013f2d023d1fde Mon Sep 17 00:00:00 2001 From: John Bender Date: Tue, 26 Jul 2011 12:45:58 -0700 Subject: [PATCH] added test for explicit page caching via data attribute --- tests/unit/navigation/cached-external.html | 10 ++++++++++ tests/unit/navigation/navigation_core.js | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/unit/navigation/cached-external.html diff --git a/tests/unit/navigation/cached-external.html b/tests/unit/navigation/cached-external.html new file mode 100644 index 00000000..f02835c4 --- /dev/null +++ b/tests/unit/navigation/cached-external.html @@ -0,0 +1,10 @@ + + + + + + +
+
+ + diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index 73de4710..ad426371 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -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(){