incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject git commit: Adding tests cases for Battery Status API
Date Fri, 20 Jan 2012 18:34:22 GMT
Updated Branches:
  refs/heads/master 5f1270415 -> 26d7797e1


Adding tests cases for Battery Status API


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/commit/26d7797e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/tree/26d7797e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/diff/26d7797e

Branch: refs/heads/master
Commit: 26d7797e1d4450878aede3d7279315048b7a82c7
Parents: 5f12704
Author: macdonst <simon.macdonald@gmail.com>
Authored: Fri Jan 20 13:34:11 2012 -0500
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Fri Jan 20 13:34:11 2012 -0500

----------------------------------------------------------------------
 autotest/tests/battery.tests.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/26d7797e/autotest/tests/battery.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/battery.tests.js b/autotest/tests/battery.tests.js
index 3d4bfaf..bce3079 100644
--- a/autotest/tests/battery.tests.js
+++ b/autotest/tests/battery.tests.js
@@ -4,4 +4,15 @@ Tests.prototype.BatteryTests = function() {
         expect(1);
         ok(navigator.battery != null, "navigator.battery should not be null.");
     });
+    /**
+     * Tests add for Battery Status API spec
+     * http://www.w3.org/TR/2011/WD-battery-status-20111129/
+     */
+    test("should have properties", function() {
+        expect(4);
+        ok(typeof navigator.battery.charging != 'undefined' && navigator.battery.charging
!= null, "navigator.battery.charging should be a boolean value.");
+        ok(typeof navigator.battery.chargingTime != 'undefined' && navigator.battery.chargingTime
!= null, "navigator.battery.chargingTime should be a double value.");
+        ok(typeof navigator.battery.level != 'undefined' && navigator.battery.level
!= null, "navigator.battery.level should be a double value.");
+        ok(typeof navigator.battery.dischargingTime != 'undefined' && navigator.battery.dischargingTime
!= null, "navigator.battery.dischargingTime should be a double value.");
+    });
 };
\ No newline at end of file


Mime
View raw message