Backed out changeset c91f7e66f342 (bug 1434844) for failures in toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js on a CLOSED TREE
authorshindli <shindli@mozilla.com>
Fri, 23 Mar 2018 02:26:15 +0200
changeset 409588 d29a10db52dc
parent 409587 285a5b8f70f3
child 409589 a71dd6219f8a
push id61578
push usershindli@mozilla.com
push dateFri, 23 Mar 2018 00:26:35 +0000
treeherderautoland@d29a10db52dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1434844
milestone61.0a1
backs outc91f7e66f342
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 c91f7e66f342 (bug 1434844) for failures in toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js on a CLOSED TREE
toolkit/mozapps/downloads/DownloadUtils.jsm
--- a/toolkit/mozapps/downloads/DownloadUtils.jsm
+++ b/toolkit/mozapps/downloads/DownloadUtils.jsm
@@ -246,17 +246,16 @@ var DownloadUtils = {
    *
    * @param aSeconds
    *        Current estimate on number of seconds left for the download
    * @param [optional] aLastSec
    *        Last time remaining in seconds or Infinity for unknown
    * @return A pair: [time left text, new value of "last seconds"]
    */
   getTimeLeft: function DU_getTimeLeft(aSeconds, aLastSec) {
-    let nf = new Services.intl.NumberFormat();
     if (aLastSec == null)
       aLastSec = Infinity;
 
     if (aSeconds < 0)
       return [gBundle.GetStringFromName(gStr.timeUnknown), aLastSec];
 
     // Try to find a cached lastSec for the given second
     aLastSec = gCachedLast.reduce((aResult, aItem) =>
@@ -289,19 +288,19 @@ var DownloadUtils = {
       // Be friendly in the last few seconds
       timeLeft = gBundle.GetStringFromName(gStr.timeFewSeconds);
     } else {
       // Convert the seconds into its two largest units to display
       let [time1, unit1, time2, unit2] =
         DownloadUtils.convertTimeUnits(aSeconds);
 
       let pair1 =
-        gBundle.formatStringFromName(gStr.timePair, [nf.format(time1), unit1], 2);
+        gBundle.formatStringFromName(gStr.timePair, [time1, unit1], 2);
       let pair2 =
-        gBundle.formatStringFromName(gStr.timePair, [nf.format(time2), unit2], 2);
+        gBundle.formatStringFromName(gStr.timePair, [time2, unit2], 2);
 
       // Only show minutes for under 1 hour unless there's a few minutes left;
       // or the second pair is 0.
       if ((aSeconds < 3600 && time1 >= 4) || time2 == 0) {
         timeLeft = gBundle.formatStringFromName(gStr.timeLeftSingle,
                                                 [pair1], 1);
       } else {
         // We've got 2 pairs of times to display