From 949dd4c6c809db5e4a83c07b3e66e583bbd6a461 Mon Sep 17 00:00:00 2001 From: John Bender Date: Tue, 8 Nov 2011 15:41:37 -0800 Subject: [PATCH] test that title is restored on link transition to first page --- tests/unit/navigation/navigation_core.js | 24 ++++++++++++++++++++++++ tests/unit/navigation/title1.html | 7 ++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index a4bfb4e2..7d61bcff 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -520,6 +520,30 @@ ]); }); + asyncTest( "Page title updates properly when clicking a link back to first page", function(){ + var title = document.title; + + $.testHelper.pageSequence([ + function(){ + $.testHelper.openPage("#ajax-title-page"); + }, + + function(){ + $("#titletest1").click(); + }, + + function(){ + same(document.title, "Title Tag"); + $.mobile.activePage.find("#title-check-link").click(); + }, + + function(){ + same(document.title, title); + start(); + } + ]); + }); + asyncTest( "Page title updates properly from title tag when loading an external page", function(){ $.testHelper.pageSequence([ function(){ diff --git a/tests/unit/navigation/title1.html b/tests/unit/navigation/title1.html index e280211f..eb83eae7 100644 --- a/tests/unit/navigation/title1.html +++ b/tests/unit/navigation/title1.html @@ -6,7 +6,8 @@ -
- +
+ back to the parent page +
- \ No newline at end of file +