spec/index.html
author Ryan Willoughby <ryan.willoughby@nitobi.com>
Tue, 06 Jul 2010 11:31:19 -0700
changeset 0 54063d8b0412
permissions -rwxr-xr-x
initial commit of PhoneGap WRT framework, licensing and test code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
  	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  	<title>QUnit results for PhoneGap JS API</title>
    <!-- You need the following two files in the same directory for QUnit to run. -->
    <link rel="stylesheet" type="text/css" href="qunit.css" />
	<script type="text/javascript" src="qunit.js"></script>
	<!-- Make sure you copy in phonegap.js from the PhoneGap repository (that's what you're testing, right?) -->
    <script type="text/javascript" src="phonegap.js"></script>
	<script type="text/javascript">
		function Tests() {
			this.TEST_TIMEOUT = 15000;
		};
		var tests = new Tests();
		
		// Runs each function in Tests that contains 'Tests' in the name.
		function run() {
			for (var t in tests) {
				if (t.indexOf('Tests') > -1) {
					tests[t]();
				}
			}
			alert('Test run complete.');
		}
		function loadTests() {
			// Shitty hack here: check for BlackBerry browser and timeout the test runner, or simply attach test runner
			// to the deviceready event if we have any other platform that can handle events.
			if (navigator.userAgent.indexOf('Browzr') > -1) {
				setTimeout(run, 250);
			} else {
				var state = document.readyState;
				if (state == "loaded" || state == "complete") {
					run();
				} else {
					document.addEventListener('deviceready', run, false);
				}
			}
		}
	</script>
	<script type="text/javascript" src="tests/accelerometer.tests.js"></script>
	<script type="text/javascript" src="tests/contacts.tests.js"></script>
	<script type="text/javascript" src="tests/camera.tests.js"></script>
	<script type="text/javascript" src="tests/device.tests.js"></script>
	<script type="text/javascript" src="tests/file.tests.js"></script>
	<script type="text/javascript" src="tests/geolocation.tests.js"></script>
	<script type="text/javascript" src="tests/map.tests.js"></script>
	<script type="text/javascript" src="tests/network.tests.js"></script>
	<script type="text/javascript" src="tests/notification.tests.js"></script>
	<script type="text/javascript" src="tests/orientation.tests.js"></script>
	<script type="text/javascript" src="tests/sms.tests.js"></script>
	<script type="text/javascript" src="tests/telephony.tests.js"></script>
	<script type="text/javascript" src="tests/storage.tests.js"></script>
  </head>
	<body onload="loadTests();">
		<h1 id="qunit-header">Mobile Spec (PhoneGap) Tests</h1>
		<h2 id="qunit-banner"></h2>
		<h2 id="qunit-userAgent"></h2>
		<ol id="qunit-tests"></ol>
	</body>
</html>