blob: 0680b7d93322dbbc55a335304888cf8c17d1d708 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>Battery Test: battery full, charger plugged in</title>
<link rel="author" title="Intel" href="">
<link rel="help" href="">
<meta name="flags" content="interact">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
This test validates that all of the BatteryManager attributes exist and are set to their correct values when battery is full.
The device is plugged in to the charger before this test is run.
The battery is full.
async_test(function (t) {
navigator.getBattery().then(function (battery) {
t.step(function () {
assert_true(battery.charging, 'charging must be set to true');
assert_equals(battery.chargingTime, 0, 'chargingTime must be set to 0');
assert_equals(battery.dischargingTime, Infinity, 'dischargingTime must be set to Infinity');
assert_equals(battery.level, 1.0, 'level must be set to 1.0');
}, function (error) {
t.step(function () {
}, document.title);