summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/battery-status/battery-full-manual.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/battery-status/battery-full-manual.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/battery-status/battery-full-manual.html')
-rw-r--r--testing/web-platform/tests/battery-status/battery-full-manual.html42
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/web-platform/tests/battery-status/battery-full-manual.html b/testing/web-platform/tests/battery-status/battery-full-manual.html
new file mode 100644
index 000000000..883d71f40
--- /dev/null
+++ b/testing/web-platform/tests/battery-status/battery-full-manual.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Battery Test: battery full, charger plugged in</title>
+<meta name="flags" content="interact">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<h2>Description</h2>
+<p>
+ This test validates that all of the BatteryManager attributes exist and are set to their correct values when battery is full.
+</p>
+
+<h2>Preconditions</h2>
+<ol>
+ <li>
+ The device is plugged in to the charger before this test is run.
+ </li>
+ <li>
+ The battery is full.
+ </li>
+</ol>
+
+<script>
+
+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');
+ });
+ t.done();
+ }, function (error) {
+ t.step(function () {
+ assert_unreached(error.message);
+ });
+ t.done();
+ });
+}, document.title);
+
+</script>