[ 
https://issues.apache.org/jira/browse/CB-6721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14005115#comment-14005115
 ] 

Jesse MacFadyen commented on CB-6721:
-------------------------------------

The reason the tests are failing on iOS is that every time we stop and start 
listening to battery level changes, the native code sets 'level' to 'null'.
In my mind, the native code should hang on to the last value it received, so 
that 'null' is only ever sent the first time the native code 'start' is called.
This can be fixed purely in javascript by ignoring status changes we receive 
where our previous value was non-null.

Some interesting edge cases are revealed by this, although I do not want to 
spend too much time on a deprecated spec...
What is the expected result of a change from :
null => LOW
null => CRITICAL

Presumably, if we choose to fire the events then every time a user starts the 
app while the battery is less than LOW it will fire.  



 

> iOS Failed test: battery.spec.4 should fire batterycritical events
> ------------------------------------------------------------------
>
>                 Key: CB-6721
>                 URL: https://issues.apache.org/jira/browse/CB-6721
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: mobile-spec, Plugin Battery Status
>            Reporter: Shazron Abdullah
>            Assignee: Jesse MacFadyen
>
> Battery (navigator.battery) battery.spec.4 should fire batterycritical events.
> timeout: timed out after 100 msec waiting for batterycritical onEvent was not 
> called when level goes from 19->5
> This test is new for CB-4520 CB-4519:
> https://github.com/apache/cordova-mobile-spec/commit/b5b80a6ff80d3c8b3d7618fe051c824ec0d3771f



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to