cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <>
Subject Re: issue in mobile-spec in automated geolocation on iOS
Date Wed, 30 May 2012 19:26:11 GMT
I've patched the test so the two test cases use a different variable to
store the ID. Thanks for looking into it Becky.

On 5/22/12 11:55 PM, "Becky Gibson" <> wrote:

>I don't know all of the nuances of jasmine yet,  but there is an issue in
>the automated geolocation tests for iOS.  Specifically this section:
>describe('watchPosition method', function() {
>        var watch = null;
>        afterEach(function() {
>            navigator.geolocation.clearWatch(watch);
>        });
>There are two tests, one to test the error callback and one to test the
>success callback for watchPosition.  What I see happening is that the
>tests runs and fails as expected.  The next test runs and calls
>watchPosition.  Then, the clearWatch gets called (I assume for the end of
>the first, fail case) with the CURRENT watch value.  Since we use the same
>watch variable for each test, it seems that clearWatch is getting called
>right after the second watchPosition and is passing in the id for that.
>The clearWatch call does what it is supposed and clears the watchId out of
>our internal list.  Since there is no longer a watchId, and the test times
>out because there is no watchId to call back out to when location data
>arrives from the sensor.   Make some semblance of sense?
>I think the fix is to separate out the tests into two separate tests but
>I'll let the Jasmine gurus take a look, please.

View raw message