Description[WebViewLayoutTest] Fix potential rounding error in testBatteryApi() layout test.
The battery.level precision test isInteger(battery.level * 100) can
occasionally fail due to rounding error,
e.g. (0.58 * 100) % 1 = 0.9999999999999929.
This patch uses toPrecision and toString methods instead to correct
this issue.
BUG=
Committed: https://crrev.com/beebf8aac8acd93bd045d94a5835e12b4992176e
Cr-Commit-Position: refs/heads/master@{#354498}
Committed: https://crrev.com/863fd741f32361a9154a61482e29944befe767ca
Cr-Commit-Position: refs/heads/master@{#354533}
Patch Set 1 #Patch Set 2 : fix the precision test #
Depends on Patchset: Messages
Total messages: 13 (4 generated)
|