incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [11/37] spec commit: bmping timeout to 5 secs and fixing compass tests
Date Wed, 18 Apr 2012 21:49:52 GMT
bmping timeout to 5 secs and fixing compass tests


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/a4222d3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/tree/a4222d3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/diff/a4222d3c

Branch: refs/heads/master
Commit: a4222d3c9bd10a782a80428a251826080bc4bfe5
Parents: 4087293
Author: Fil Maj <maj.fil@gmail.com>
Authored: Thu Apr 12 16:58:00 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Mon Apr 16 16:06:59 2012 -0700

----------------------------------------------------------------------
 autotest/test-runner.js         |    2 +-
 autotest/tests/compass.tests.js |   55 ++++++++++++++++++++++------------
 2 files changed, 37 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/a4222d3c/autotest/test-runner.js
----------------------------------------------------------------------
diff --git a/autotest/test-runner.js b/autotest/test-runner.js
index 243f2da..f16c1cd 100644
--- a/autotest/test-runner.js
+++ b/autotest/test-runner.js
@@ -28,4 +28,4 @@ if (window.sessionStorage != null) {
 // time to query the response. This is important for some
 // Android devices.
 var Tests = function() {};
-Tests.TEST_TIMEOUT = 2000;
+Tests.TEST_TIMEOUT = 5000;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/a4222d3c/autotest/tests/compass.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/compass.tests.js b/autotest/tests/compass.tests.js
index e8f311b..924dcb4 100644
--- a/autotest/tests/compass.tests.js
+++ b/autotest/tests/compass.tests.js
@@ -1,10 +1,11 @@
 describe('Compass (navigator.compass)', function () {
-	it("should exist", function() {
-      expect(navigator.compass).toBeDefined();
-	});
+    it("should exist", function() {
+        expect(navigator.compass).toBeDefined();
+    });
 
-	it("should contain a getCurrentHeading function", function() {
+    it("should contain a getCurrentHeading function", function() {
         expect(navigator.compass.getCurrentHeading).toBeDefined();
+<<<<<<< HEAD
 		expect(typeof navigator.compass.getCurrentHeading == 'function').toBe(true);
 	});
 <<<<<<< HEAD
@@ -34,9 +35,13 @@ describe('Compass (navigator.compass)', function () {
 =======
 >>>>>>> converted some more tests to jasmine
 >>>>>>> converted some more tests to jasmine
+=======
+        expect(typeof navigator.compass.getCurrentHeading == 'function').toBe(true);
+    });
+>>>>>>> bmping timeout to 5 secs and fixing compass tests
 
-	it("getCurrentHeading success callback should be called with a Heading object", function()
{
-		var win = jasmine.createSpy().andCallFake(function(a) {
+    it("getCurrentHeading success callback should be called with a Heading object", function()
{
+        var win = jasmine.createSpy().andCallFake(function(a) {
                 expect(a instanceof CompassHeading).toBe(true);
                 expect(a.magneticHeading).toBeDefined();
                 expect(typeof a.magneticHeading == 'number').toBe(true);
@@ -44,12 +49,12 @@ describe('Compass (navigator.compass)', function () {
                 expect(typeof a.trueHeading == 'number' || a.trueHeading === null).toBe(true);
                 expect(a.headingAccuracy).not.toBe(undefined);
                 expect(typeof a.headingAccuracy == 'number' || a.headingAccuracy === null).toBe(true);
-                expect(a.timestamp instanceof Date).toBe(true);
+                expect(typeof a.timestamp == 'number').toBe(true);
             }),
             fail = jasmine.createSpy();
 
         runs(function () {
-		    navigator.compass.getCurrentHeading(win, fail);
+            navigator.compass.getCurrentHeading(win, fail);
         });
 
         waitsFor(function () { return win.wasCalled; }, "success callback never called",
Tests.TEST_TIMEOUT);
@@ -60,11 +65,14 @@ describe('Compass (navigator.compass)', function () {
         });
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> converted some more tests to jasmine
 =======
 =======
 >>>>>>> converted some more tests to jasmine
 =======
+>>>>>>> bmping timeout to 5 secs and fixing compass tests
+=======
 	test("getCurrentHeading success callback should be called with a Heading object", function()
{
 		expect(9);
 		QUnit.stop(Tests.TEST_TIMEOUT);
@@ -90,19 +98,22 @@ describe('Compass (navigator.compass)', function () {
 >>>>>>> converted some more tests to jasmine
 >>>>>>> converted some more tests to jasmine
 	});
+=======
+    });
+>>>>>>> bmping timeout to 5 secs and fixing compass tests
 
-	it("should contain a watchHeading function", function() {
+    it("should contain a watchHeading function", function() {
         expect(navigator.compass.watchHeading).toBeDefined();
-		expect(typeof navigator.compass.watchHeading == 'function').toBe(true);
-	});
+        expect(typeof navigator.compass.watchHeading == 'function').toBe(true);
+    });
 
-	it("should contain a clearWatch function", function() {
+    it("should contain a clearWatch function", function() {
         expect(navigator.compass.clearWatch).toBeDefined();
-		expect(typeof navigator.compass.clearWatch == 'function').toBe(true);
-	});
+        expect(typeof navigator.compass.clearWatch == 'function').toBe(true);
+    });
 
     describe('Compass Constants (window.CompassError)', function () {
-        it("CompassError globals should exist", function() {
+        it("should exist", function() {
             expect(window.CompassError).toBeDefined();
             expect(window.CompassError.COMPASS_INTERNAL_ERR).toBe(0);
             expect(window.CompassError.COMPASS_NOT_SUPPORTED).toBe(20);
@@ -110,21 +121,22 @@ describe('Compass (navigator.compass)', function () {
     });
 
     describe('Compass Heading model (CompassHeading)', function () {
-        it("CompassHeading function should exist", function() {
+        it("should exist", function() {
             expect(CompassHeading).toBeDefined();
         });
 
-        it("Creating a new CompassHeading instance with no parameters", function() {
+        it("should be able to create a new CompassHeading instance with no parameters", function()
{
             var h = new CompassHeading();
             expect(h.magneticHeading).toBeDefined();
             expect(h.trueHeading).toBeDefined();
             expect(h.headingAccuracy).toBeDefined();
-            expect(h.timestamp instanceof Date).toBe(true);
+            expect(typeof h.timestamp == 'number').toBe(true);
         });
 
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
   module('Compass Heading model (CompassHeading)');
   test("CompassHeading function should exist", function() {
     expect(1);
@@ -154,15 +166,20 @@ describe('Compass (navigator.compass)', function () {
 >>>>>>> Fixes CB-439 Compass timestamp specified in milliseconds
 =======
 =======
+>>>>>>> bmping timeout to 5 secs and fixing compass tests
+=======
 >>>>>>> converted some more tests to jasmine
 >>>>>>> converted some more tests to jasmine
         it("Creating a new CompassHeading instance with parameters", function() {
+=======
+        it("should be able to creat a new CompassHeading instance with parameters", function()
{
+>>>>>>> bmping timeout to 5 secs and fixing compass tests
             var h = new CompassHeading(1,2,3,4);
             expect(h.magneticHeading).toBe(1);
             expect(h.trueHeading).toBe(2);
             expect(h.headingAccuracy).toBe(3);
             expect(h.timestamp.valueOf()).toBe(4);
-            expect(h.timestamp instanceof Date).toBe(true);
+            expect(typeof h.timestamp == 'number').toBe(true);
         });
     });
 });


Mime
View raw message