|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
|
3 <head> |
|
4 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> |
|
5 <title>QUnit results for PhoneGap JS API</title> |
|
6 <!-- You need the following two files in the same directory for QUnit to run. --> |
|
7 <link rel="stylesheet" type="text/css" href="qunit.css" /> |
|
8 <script type="text/javascript" src="qunit.js"></script> |
|
9 <!-- Make sure you copy in phonegap.js from the PhoneGap repository (that's what you're testing, right?) --> |
|
10 <script type="text/javascript" src="phonegap.js"></script> |
|
11 <script type="text/javascript"> |
|
12 function Tests() { |
|
13 this.TEST_TIMEOUT = 15000; |
|
14 }; |
|
15 var tests = new Tests(); |
|
16 |
|
17 // Runs each function in Tests that contains 'Tests' in the name. |
|
18 function run() { |
|
19 for (var t in tests) { |
|
20 if (t.indexOf('Tests') > -1) { |
|
21 tests[t](); |
|
22 } |
|
23 } |
|
24 alert('Test run complete.'); |
|
25 } |
|
26 function loadTests() { |
|
27 // Shitty hack here: check for BlackBerry browser and timeout the test runner, or simply attach test runner |
|
28 // to the deviceready event if we have any other platform that can handle events. |
|
29 if (navigator.userAgent.indexOf('Browzr') > -1) { |
|
30 setTimeout(run, 250); |
|
31 } else { |
|
32 var state = document.readyState; |
|
33 if (state == "loaded" || state == "complete") { |
|
34 run(); |
|
35 } else { |
|
36 document.addEventListener('deviceready', run, false); |
|
37 } |
|
38 } |
|
39 } |
|
40 </script> |
|
41 <script type="text/javascript" src="tests/accelerometer.tests.js"></script> |
|
42 <script type="text/javascript" src="tests/contacts.tests.js"></script> |
|
43 <script type="text/javascript" src="tests/camera.tests.js"></script> |
|
44 <script type="text/javascript" src="tests/device.tests.js"></script> |
|
45 <script type="text/javascript" src="tests/file.tests.js"></script> |
|
46 <script type="text/javascript" src="tests/geolocation.tests.js"></script> |
|
47 <script type="text/javascript" src="tests/map.tests.js"></script> |
|
48 <script type="text/javascript" src="tests/network.tests.js"></script> |
|
49 <script type="text/javascript" src="tests/notification.tests.js"></script> |
|
50 <script type="text/javascript" src="tests/orientation.tests.js"></script> |
|
51 <script type="text/javascript" src="tests/sms.tests.js"></script> |
|
52 <script type="text/javascript" src="tests/telephony.tests.js"></script> |
|
53 <script type="text/javascript" src="tests/storage.tests.js"></script> |
|
54 </head> |
|
55 <body onload="loadTests();"> |
|
56 <h1 id="qunit-header">Mobile Spec (PhoneGap) Tests</h1> |
|
57 <h2 id="qunit-banner"></h2> |
|
58 <h2 id="qunit-userAgent"></h2> |
|
59 <ol id="qunit-tests"></ol> |
|
60 </body> |
|
61 </html> |