mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-29 02:14:44 +00:00
setup pushstate tests
This commit is contained in:
parent
5775dd19a4
commit
886cdcf927
3 changed files with 70 additions and 2 deletions
1
tests/unit/jquery.disablePushState.js
Normal file
1
tests/unit/jquery.disablePushState.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
$.support.pushState = false;
|
||||
|
|
@ -18,8 +18,6 @@
|
|||
});
|
||||
|
||||
asyncTest( "can navigate between internal and external pages", function(){
|
||||
$.support.pushState = true;
|
||||
|
||||
$.testHelper.pageSequence([
|
||||
function(){
|
||||
// Navigate from default internal page to another internal page.
|
||||
|
|
|
|||
69
tests/unit/navigation/push-state-base-tests.html
Normal file
69
tests/unit/navigation/push-state-base-tests.html
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>jQuery Mobile Navigation Test Suite</title>
|
||||
|
||||
<script>
|
||||
|
||||
// This unit test requires a base tag to be set within the file.
|
||||
// Most browsers require a base tag with an @href URL that is absolute.
|
||||
// We need to dynamically inject the base tag so we can prefix it with
|
||||
// the location of this test on the server without any server-side language
|
||||
// requirements.
|
||||
|
||||
var baseUrl = location.href.replace(/[^\?\#\/]*(\?[^#]*)?(#.*)?$/, "");
|
||||
document.write("<base href=\"" + baseUrl + "base-tests/app-base/\"/>\n");
|
||||
|
||||
</script>
|
||||
<script src="../../../../../js/jquery.js"></script>
|
||||
<script src="../../../jquery.setNameSpace.js"></script>
|
||||
<script src="../../../../../js/"></script>
|
||||
<script src="../../../../../tests/jquery.testHelper.js"></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../../../themes/default/"/>
|
||||
<link rel="stylesheet" href="../../../../../external/qunit.css"/>
|
||||
<script src="../../../../../external/qunit.js"></script>
|
||||
<script src="../../../jquery.disablePushState.js"></script>
|
||||
<script src="../../navigation_base.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="qunit-header">jQuery Mobile Navigation Disabled Push State Base Tag Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests">
|
||||
</ol>
|
||||
|
||||
<div id="internal-page-1" data-nstest-role="page">
|
||||
<a href="base-page-1.html" class="bp1"></a>
|
||||
<a href="base-page-2.html" class="bp2"></a>
|
||||
<a href="../content/content-page-1.html" class="cp1"></a>
|
||||
<a href="../content/content-page-2.html" class="cp2"></a>
|
||||
<a href="#internal-page-2" class="ip2"></a>
|
||||
<img src="images/internal-page-1.png">
|
||||
</div>
|
||||
|
||||
<div id="internal-page-2" data-nstest-role="page">
|
||||
<a href="base-page-1.html" class="bp1"></a>
|
||||
<a href="base-page-2.html" class="bp2"></a>
|
||||
<a href="../content/content-page-1.html" class="cp1"></a>
|
||||
<a href="../content/content-page-2.html" class="cp2"></a>
|
||||
<a href="#internal-page-1" class="ip1"></a>
|
||||
<img src="images/internal-page-2.png">
|
||||
</div>
|
||||
|
||||
<div data-nstest-role="page" id="internal-no-action-form-page">
|
||||
<div data-nstest-role="content">
|
||||
<form>
|
||||
<input type="hidden" name="foo" value="1">
|
||||
<input type="hidden" name="bar" value="2">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue