Backed out changeset 7bb636bd183b (bug 1250106) for test_deprecated_battery_basics.html failures CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Mon, 07 Mar 2016 17:03:16 -0800
changeset 287159 fb5b94df3eca18d57dd685e325294d5a5b88e072
parent 287158 0e4c29a5ea1568f9ddaee553ca2f45111ecb27ef
child 287160 6312f4020b6d91372c9b4f69e5fa1c02bc1148ef
push id30065
push userkwierso@gmail.com
push dateWed, 09 Mar 2016 00:01:05 +0000
treeherdermozilla-central@886b5480b578 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1250106
milestone47.0a1
backs out7bb636bd183b96f1c61ee24cd67da024d699c69c
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 7bb636bd183b (bug 1250106) for test_deprecated_battery_basics.html failures CLOSED TREE MozReview-Commit-ID: GuZQHh8G8YC
dom/battery/BatteryManager.cpp
--- a/dom/battery/BatteryManager.cpp
+++ b/dom/battery/BatteryManager.cpp
@@ -135,29 +135,25 @@ BatteryManager::UpdateFromBatteryInfo(co
 
   // Round to the nearest ten percent for non-chrome and non-certified apps
   nsIDocument* doc = GetOwner()->GetDoc();
   uint16_t status = nsIPrincipal::APP_STATUS_NOT_INSTALLED;
   if (doc) {
     doc->NodePrincipal()->GetAppStatus(&status);
   }
 
-  mCharging = aBatteryInfo.charging();
-  mRemainingTime = aBatteryInfo.remainingTime();
-
   if (!nsContentUtils::IsChromeDoc(doc) &&
       status != nsIPrincipal::APP_STATUS_CERTIFIED)
   {
     mLevel = lround(mLevel * 10.0) / 10.0;
-    if (mLevel == 1.0) {
-      mCharging = false;
-      mRemainingTime = kDefaultRemainingTime;
-    }
   }
 
+  mCharging = aBatteryInfo.charging();
+  mRemainingTime = aBatteryInfo.remainingTime();
+
   // Add some guards to make sure the values are coherent.
   if (mLevel == 1.0 && mCharging == true &&
       mRemainingTime != kDefaultRemainingTime) {
     mRemainingTime = kDefaultRemainingTime;
     NS_ERROR("Battery API: When charging and level at 1.0, remaining time "
              "should be 0. Please fix your backend!");
   }
 }