From 151d55f351b2bbaf716c9fadea8d93ab9ade262e Mon Sep 17 00:00:00 2001 From: John Bender Date: Tue, 26 Jul 2011 11:53:21 -0700 Subject: [PATCH] moved dom cache test to page sequence, negative case incoming --- tests/unit/navigation/navigation_core.js | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index 0fd3de12..73de4710 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -24,21 +24,24 @@ } }); - asyncTest( "External page is removed from the DOM after pagehide", function(){ + asyncTest( "external page is removed from the DOM after pagehide", function(){ + $.testHelper.pageSequence([ + function(){ + $.mobile.changePage( "external.html" ); + }, - $( "#external-test" ) - .live( "pageshow", function(){ + // page is pulled and displayed in the dom + function(){ + same( $( "#external-test" ).length, 1 ); window.history.back(); - }) - .live( "pagehide", function(){ - setTimeout(function(){ - same( $( "#external-test" ).length, 0 ); - start(); - }, 500); - }); - - $.mobile.changePage( "external.html" ); + }, + // external-test is *NOT* cached in the dom after transitioning away + function(){ + same( $( "#external-test" ).length, 0 ); + start(); + } + ]); }); asyncTest( "forms with data attribute ajax set to false will not call changePage", function(){