added test for prefetched dialog pages

This commit is contained in:
John Bender 2011-10-11 16:13:09 -07:00
parent 61f68189d5
commit 475069becd
3 changed files with 38 additions and 0 deletions

View file

@ -277,5 +277,14 @@
<div id="inject-links-page" data-nstest-role="page">
<a href="#injected-test-page" id="static-injected-test-page-link">static link</a>
</div>
<div id="prefetched-dialog-page" data-nstest-role="page">
<a href="prefetched-dialog.html"
id="prefetched-dialog-link"
data-nstest-role="prefetch"
data-nstest-rel="dialog">
static link
</a>
</div>
</body>
</html>

View file

@ -930,6 +930,25 @@
]);
});
asyncTest( "prefetched links with data rel dialog result in a dialog", function() {
$.testHelper.pageSequence([
// open our test page
function(){
// Navigate to any page except the first page of the application.
$.testHelper.openPage("#prefetched-dialog-page");
},
function() {
$("#prefetched-dialog-link").click();
},
function() {
ok( $.mobile.activePage.is(".ui-dialog"), "prefetched page is rendered as a dialog" );
start();
}
]);
});
asyncTest( "application url with dialogHashKey loads application's first page", function(){
$.testHelper.pageSequence([

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title Tag</title>
</head>
<body>
<div data-nstest-role="page" id="prefetched-dialog"></div>
</body>
</html>