forked from browserstate/history.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made the tests static. A few tests are failing though.
- Loading branch information
Showing
38 changed files
with
1,666 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
<?php | ||
# Check | ||
if ( empty($_SERVER['REQUEST_URI']) ) { | ||
die('run this in your browser'); | ||
} | ||
|
||
# Locations | ||
$dir = dirname(__FILE__); | ||
$out = "$dir/../tests"; | ||
|
||
# Base URL | ||
$relative_url = $_SERVER['REQUEST_URI']; | ||
$relative_url = substr($relative_url,0,strpos($relative_url,'/history.js')).'/history.js/'; | ||
$base_url = 'http://'.$_SERVER['HTTP_HOST'].$relative_url; | ||
$tests_url = $base_url.'tests/'; | ||
|
||
# Dirs | ||
$dirs = array('uncompressed','compressed'); | ||
$tests_url = $base_url.'tests'; | ||
|
||
# Support | ||
$supports = array('html5','html4'); | ||
# Compress | ||
$compress = array('uncompressed','compressed'); | ||
|
||
# Persist | ||
$persists = array('persistant','non-persistant'); | ||
|
||
# Support | ||
$supports = array('html5','html4'); | ||
|
||
# Adapter | ||
$adapters = array('jquery','mootools','prototype','zepto'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
# Header | ||
require_once(dirname(__FILE__).'/_header.php'); | ||
|
||
# Index | ||
ob_start(); | ||
require($dir.'/all.php'); | ||
$contents = ob_get_contents(); | ||
ob_end_clean(); | ||
file_put_contents($out.'/index.html', $contents); | ||
|
||
# Each | ||
foreach ( $compress as $compression ) | ||
foreach ( $supports as $support ) | ||
foreach ( $persists as $persist ) | ||
foreach ( $adapters as $adapter ) { | ||
ob_start(); | ||
require($dir.'/each.php'); | ||
$contents = ob_get_contents(); | ||
ob_end_clean(); | ||
file_put_contents($out."/${filename}", $contents); | ||
} | ||
|
||
# Done | ||
?><html><body><a href="../tests">Tests</a></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
Options +FollowSymlinks | ||
RewriteEngine On | ||
RewriteBase / | ||
|
||
# Clean Adapter | ||
RewriteCond %{REQUEST_FILENAME} !index.php$ | ||
RewriteRule ([a-z]+)/([a-z0-9_\-]+)/([a-z0-9_\-]+)/([a-z0-9_\-]+)/?$ products/history.js/tests/frame.php?dir=$1&support=$2&persist=$3&adapter=$4 [NC,L,QSA] | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ([^\.]+)$ $1.html [NC,L,QSA] | ||
|
||
# To alter the above for your test environment, all you need to do is change "products/history.js" to wherever history.js is located on your webserver. For example for me it's located at "http://localhost/products/history.js" - if for you it is located at "http://localhost/history.js" then you would change "products/history.js" to "history.js" | ||
# Can someone smarter than me make it so: | ||
# http://localhost/history.js/tests/uncompressed-html5-persistant-jquery | ||
# Does not redirect to: | ||
# http://localhost/history.js/tests/uncompressed-html5-persistant-jquery.html | ||
# But still accesses that url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" /> | ||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" /> | ||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<title>History.js Compressed HTML4 Non-persistant Jquery Test Suite</title> | ||
|
||
<!-- Check --> | ||
<script> | ||
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-non-persistant-jquery.html" ) { | ||
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-non-persistant-jquery.html"; | ||
} | ||
</script> | ||
|
||
<!-- Framework --> | ||
<script src="../vendor/jquery.js"></script> | ||
|
||
<!-- QUnit --> | ||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen"> | ||
<script src="../vendor/qunit/qunit/qunit.js"></script> | ||
</head> | ||
<body> | ||
<!-- Elements --> | ||
<h1 id="qunit-header">History.js Compressed HTML4 Non-persistant Jquery Test Suite</h1> | ||
<h2 id="qunit-banner"></h2> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
<div id="qunit-fixture">test markup</div> | ||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button> | ||
<textarea id="log" style="width:100%;height:400px"></textarea> | ||
|
||
<!-- FireBug Lite --> | ||
<script>if ( typeof window.console === 'undefined' ) { document.write('<script src=".../vendor/firebug-lite.js"><\/script>'); }</script> | ||
|
||
<!-- JSON --> | ||
<script>if ( typeof window.JSON === 'undefined' ) { document.write('<script src="../scripts//Users/balupton/Dropbox/Server/public_html/products/history.js/tests.src/json2.js"><\/script>'); }</script> | ||
|
||
<!-- History.js --> | ||
<script src="../scripts/compressed/history.adapter.jquery.js"></script> | ||
<script src="../scripts/compressed/history.js"></script> | ||
<script src="../scripts/compressed/history.html4.js"></script> | ||
|
||
<!-- Tests --> | ||
<script src="tests.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" /> | ||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" /> | ||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<title>History.js Compressed HTML4 Non-persistant Mootools Test Suite</title> | ||
|
||
<!-- Check --> | ||
<script> | ||
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-non-persistant-mootools.html" ) { | ||
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-non-persistant-mootools.html"; | ||
} | ||
</script> | ||
|
||
<!-- Framework --> | ||
<script src="../vendor/mootools.js"></script> | ||
|
||
<!-- QUnit --> | ||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen"> | ||
<script src="../vendor/qunit/qunit/qunit.js"></script> | ||
</head> | ||
<body> | ||
<!-- Elements --> | ||
<h1 id="qunit-header">History.js Compressed HTML4 Non-persistant Mootools Test Suite</h1> | ||
<h2 id="qunit-banner"></h2> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
<div id="qunit-fixture">test markup</div> | ||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button> | ||
<textarea id="log" style="width:100%;height:400px"></textarea> | ||
|
||
<!-- FireBug Lite --> | ||
<script>if ( typeof window.console === 'undefined' ) { document.write('<script src=".../vendor/firebug-lite.js"><\/script>'); }</script> | ||
|
||
<!-- JSON --> | ||
<script>if ( typeof window.JSON === 'undefined' ) { document.write('<script src="../scripts//Users/balupton/Dropbox/Server/public_html/products/history.js/tests.src/json2.js"><\/script>'); }</script> | ||
|
||
<!-- History.js --> | ||
<script src="../scripts/compressed/history.adapter.mootools.js"></script> | ||
<script src="../scripts/compressed/history.js"></script> | ||
<script src="../scripts/compressed/history.html4.js"></script> | ||
|
||
<!-- Tests --> | ||
<script src="tests.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" /> | ||
<meta http-equiv="PRAGMA" CONTENT="NO-CACHE" /> | ||
<meta http-equiv="CACHE-CONTROL" CONTENT="NO-CACHE" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<title>History.js Compressed HTML4 Non-persistant Prototype Test Suite</title> | ||
|
||
<!-- Check --> | ||
<script> | ||
if ( window.document.location.href !== "http://localhost/products/history.js/tests/compressed-html4-non-persistant-prototype.html" ) { | ||
window.document.location.href = "http://localhost/products/history.js/tests/compressed-html4-non-persistant-prototype.html"; | ||
} | ||
</script> | ||
|
||
<!-- Framework --> | ||
<script src="../vendor/prototype.js"></script> | ||
|
||
<!-- QUnit --> | ||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css" type="text/css" media="screen"> | ||
<script src="../vendor/qunit/qunit/qunit.js"></script> | ||
</head> | ||
<body> | ||
<!-- Elements --> | ||
<h1 id="qunit-header">History.js Compressed HTML4 Non-persistant Prototype Test Suite</h1> | ||
<h2 id="qunit-banner"></h2> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
<div id="qunit-fixture">test markup</div> | ||
<button onclick="history.back()">back</button><button onclick="history.forward()">forward</button> | ||
<textarea id="log" style="width:100%;height:400px"></textarea> | ||
|
||
<!-- FireBug Lite --> | ||
<script>if ( typeof window.console === 'undefined' ) { document.write('<script src=".../vendor/firebug-lite.js"><\/script>'); }</script> | ||
|
||
<!-- JSON --> | ||
<script>if ( typeof window.JSON === 'undefined' ) { document.write('<script src="../scripts//Users/balupton/Dropbox/Server/public_html/products/history.js/tests.src/json2.js"><\/script>'); }</script> | ||
|
||
<!-- History.js --> | ||
<script src="../scripts/compressed/history.adapter.prototype.js"></script> | ||
<script src="../scripts/compressed/history.js"></script> | ||
<script src="../scripts/compressed/history.html4.js"></script> | ||
|
||
<!-- Tests --> | ||
<script src="tests.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.