[
https://issues.apache.org/jira/browse/CB-6721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14003043#comment-14003043
]
Shazron Abdullah commented on CB-6721:
--------------------------------------
"null" (unknown) *is* a change however, so perhaps the null check is not needed.
After testing some more -- the culprit I think is when the tests are running,
the actual battery value is being set (in this case of my device it is 100), so
the test values are not what are expected. 19 was set, then set to 5. But in
the meantime the native side sets it to 100. 19 -> 100 -> 5.
In this case, because of the if statements in battery.js (100->5), it would
have sent out a batterylow event (thus the test failed because it expected a
batterycritical event). I'm not sure why the if statements check me._level - if
the thresholds are at 20 (batterylow) and 5 (batterycritical), we would only
care about the info.level value. It is clear that a 100->5 transition is a
batterycritical event, for example.
> 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
>
> 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)