Permalink
Browse files

tweaking init and ordering of tests

  • Loading branch information...
1 parent 5dbee6c commit 46ba34ee33c975afefa65853876531b3be4fb0fc @filmaj filmaj committed Jan 19, 2012
Showing with 23 additions and 24 deletions.
  1. +23 −4 autotest/index.html
  2. +0 −20 autotest/test-runner.js
View
@@ -10,12 +10,12 @@
<link rel="stylesheet" type="text/css" href="qunit.css" />
<script type="text/javascript" src="qunit.js"></script>
- <!-- Load Test Runner -->
- <script type="text/javascript" src="test-runner.js"></script>
-
<!-- Source -->
<script type="text/javascript" src="../phonegap.js"></script>
-
+
+ <!-- Load Test Runner -->
+ <script type="text/javascript" src="test-runner.js"></script>
+
<!-- Tests -->
<script type="text/javascript" src="tests/accelerometer.tests.js"></script>
<script type="text/javascript" src="tests/battery.tests.js"></script>
@@ -29,6 +29,25 @@
<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/storage.tests.js"></script>
+ <script type="text/javascript">
+ document.addEventListener('deviceready', function() {
+ console.log('running tests');
+ var tests = new Tests();
+
+ // Each group of tests are declared as a function in the object `Tests`.
+ // A group of tests are identified by a name that contains the word 'Tests'.
+ //
+ // Load each group of tests into QUnit
+ for (var t in tests) {
+ if (t.indexOf('Tests') > -1) {
+ tests[t]();
+ }
+ }
+
+ // Start the QUnit test suite
+ QUnit.start();
+ }, false);
+ </script>
</head>
<body>
<h1 id="qunit-header">PhoneGap API Spec</h1>
View
@@ -7,23 +7,3 @@ sessionStorage.clear();
// Android devices.
var Tests = function() {};
Tests.TEST_TIMEOUT = 2000;
-
-
-document.addEventListener('DOMContentLoaded', function() {
- document.addEventListener('deviceready', function() {
- var tests = new Tests();
-
- // Each group of tests are declared as a function in the object `Tests`.
- // A group of tests are identified by a name that contains the word 'Tests'.
- //
- // Load each group of tests into QUnit
- for (var t in tests) {
- if (t.indexOf('Tests') > -1) {
- tests[t]();
- }
- }
-
- // Start the QUnit test suite
- QUnit.start();
- }, false);
-}, false);

0 comments on commit 46ba34e

Please sign in to comment.