forked from silentrob/mobile-spec
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·81 lines (71 loc) · 3.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!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>
<!-- 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>
// Hook window.addEventListener for 'load' event used by qunit.
// The load function must run after deviceready event is received from PhoneGap.
var windowEventListener = window.addEventListener;
var qunitLoadFunction = null;
window.addEventListener = function(type, f, b) {
if (type != 'load') {
windowEventListener(type, f, b);
}
else {
qunitLoadFunction = f;
}
}
</script>
<!-- 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">
// Override QUnit.done function to display result of tests
QUnit.done = function(failures, total) {
console.log("Test run complete: "+failures+" tests failed out of "+total+" tests.");
alert("Test run complete: "+failures+" tests failed out of "+total+" tests.");
}
// Tests to run
function Tests() {
this.TEST_TIMEOUT = 15000;
};
var tests = new Tests();
// Runs each function in Tests that contains 'Tests' in the name.
function run() {
// Deviceready has fired, so now qunit can be loaded
if (qunitLoadFunction) {
qunitLoadFunction();
}
for (var t in tests) {
if (t.indexOf('Tests') > -1) {
tests[t]();
}
}
}
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>
<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>