Repository: cordova-plugin-device-motion Updated Branches: refs/heads/master 1ca1328ed -> 67f508de7
CB-8083 Adds test to make sure success callback is called each time Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/67f508de Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/67f508de Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/67f508de Branch: refs/heads/master Commit: 67f508de7816bb94b3fa7edbee752050005dd051 Parents: 1ca1328 Author: sgrebnov <[email protected]> Authored: Wed Dec 3 20:59:25 2014 +0300 Committer: sgrebnov <[email protected]> Committed: Wed Dec 3 22:42:27 2014 +0300 ---------------------------------------------------------------------- tests/tests.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/67f508de/tests/tests.js ---------------------------------------------------------------------- diff --git a/tests/tests.js b/tests/tests.js index 6bcd61c..159bf9b 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -1,4 +1,4 @@ -/* +/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -140,6 +140,19 @@ exports.defineAutoTests = function () { id = navigator.accelerometer.watchAcceleration(win, fail.bind(null,done), {frequency:100}); }); + + it("accelerometer.spec.12 success callback should be preserved and called several times", function (done) { + var callbacksCallCount = 0, + callbacksCallTestCount = 3; + + var win = function (a) { + if (callbacksCallCount++ < callbacksCallTestCount) return; + expect(typeof a).toBe('object'); + done(); + }; + + id = navigator.accelerometer.watchAcceleration(win, fail.bind(null, done), { frequency: 100 }); + }); }); describe("clearWatch", function() { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
