tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

battery-full-manual.https.html (1287B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Battery Test: battery full, charger plugged in</title>
      4 <link rel="author" title="Intel" href="http://www.intel.com">
      5 <link rel="help" href="https://www.w3.org/TR/battery-status/">
      6 <meta name="flags" content="interact">
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 
     10 <h2>Description</h2>
     11 <p>
     12  This test validates that all of the BatteryManager attributes exist and are set to their correct values when battery is full.
     13 </p>
     14 
     15 <h2>Preconditions</h2>
     16 <ol>
     17  <li>
     18    The device is plugged in to the charger before this test is run.
     19  </li>
     20  <li>
     21    The battery is full.
     22  </li>
     23 </ol>
     24 
     25 <script>
     26 
     27 async_test(function (t) {
     28  navigator.getBattery().then(function (battery) {
     29    t.step(function () {
     30      assert_true(battery.charging, 'charging must be set to true');
     31      assert_equals(battery.chargingTime, 0, 'chargingTime must be set to 0');
     32      assert_equals(battery.dischargingTime, Infinity, 'dischargingTime must be set to Infinity');
     33      assert_equals(battery.level, 1.0, 'level must be set to 1.0');
     34    });
     35    t.done();
     36  }, function (error) {
     37    t.step(function () {
     38      assert_unreached(error.message);
     39    });
     40    t.done();
     41  });
     42 }, document.title);
     43 
     44 </script>