cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesj...@apache.org
Subject spec commit: CB-5035 wait to prevent test interference
Date Tue, 15 Oct 2013 19:22:38 GMT
Updated Branches:
  refs/heads/master 22d81e479 -> fee17d9dd


CB-5035 wait to prevent test interference


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

Branch: refs/heads/master
Commit: fee17d9dd6bdfdaaf89d32b43ed8b1adad806254
Parents: 22d81e4
Author: James Jong <wjamesjong@gmail.com>
Authored: Tue Oct 15 15:19:23 2013 -0400
Committer: James Jong <wjamesjong@gmail.com>
Committed: Tue Oct 15 15:19:23 2013 -0400

----------------------------------------------------------------------
 autotest/tests/accelerometer.tests.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/fee17d9d/autotest/tests/accelerometer.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/accelerometer.tests.js b/autotest/tests/accelerometer.tests.js
index 2ad466c..029db05 100644
--- a/autotest/tests/accelerometer.tests.js
+++ b/autotest/tests/accelerometer.tests.js
@@ -25,6 +25,16 @@ describe('Accelerometer (navigator.accelerometer)', function () {
     });
 
     describe("getCurrentAcceleration", function() {
+        afterEach(function(){
+            // wait between testcases to avoid interference
+            var flag=false;
+            runs(function() {
+                setTimeout(function() {flag = true;}, 500);
+            });
+
+            waitsFor(function() {return flag;}, "flag to be true", Tests.TEST_TIMEOUT);
+        });
+
         it("accelerometer.spec.2 should exist", function() {
             expect(typeof navigator.accelerometer.getCurrentAcceleration).toBeDefined();
             expect(typeof navigator.accelerometer.getCurrentAcceleration == 'function').toBe(true);


Mime
View raw message