Bug 812894 - Use the short time format for downloading remaining time.; r?paolo draft
authorSean Lee <selee@mozilla.com>
Thu, 08 Dec 2016 23:21:23 -1000
changeset 457253 5ceb7e0eb867af3f6bbbe7200ce898c66f46e7c5
parent 457090 0d823cf54df53e0cea75a74adebace956bd333d8
child 541442 5ca036137f35e55c9ffd89fd9d37252af4625831
push id40732
push userbmo:selee@mozilla.com
push dateSat, 07 Jan 2017 14:58:54 +0000
reviewerspaolo
bugs812894
milestone53.0a1
Bug 812894 - Use the short time format for downloading remaining time.; r?paolo MozReview-Commit-ID: 8riIUa7MCfr
browser/components/downloads/DownloadsViewUI.jsm
browser/locales/en-US/chrome/browser/downloads/downloads.dtd
toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties
toolkit/mozapps/downloads/DownloadUtils.jsm
toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
--- a/browser/components/downloads/DownloadsViewUI.jsm
+++ b/browser/components/downloads/DownloadsViewUI.jsm
@@ -192,26 +192,18 @@ this.DownloadsViewUI.DownloadElementShel
     let s = DownloadsCommon.strings;
 
     let text = "";
     let tip = "";
 
     if (!this.download.stopped) {
       let totalBytes = this.download.hasProgress ? this.download.totalBytes
                                                  : -1;
-      // By default, extended status information including the individual
-      // download rate is displayed in the tooltip. The history view overrides
-      // the getter and displays the datails in the main area instead.
-      [text] = DownloadUtils.getDownloadStatusNoRate(
-                                          this.download.currentBytes,
-                                          totalBytes,
-                                          this.download.speed,
-                                          this.lastEstimatedSecondsLeft);
       let newEstimatedSecondsLeft;
-      [tip, newEstimatedSecondsLeft] = DownloadUtils.getDownloadStatus(
+      [text, newEstimatedSecondsLeft] = DownloadUtils.getDownloadStatus(
                                           this.download.currentBytes,
                                           totalBytes,
                                           this.download.speed,
                                           this.lastEstimatedSecondsLeft);
       this.lastEstimatedSecondsLeft = newEstimatedSecondsLeft;
     } else if (this.download.canceled && this.download.hasPartialData) {
       let totalBytes = this.download.hasProgress ? this.download.totalBytes
                                                  : -1;
--- a/browser/locales/en-US/chrome/browser/downloads/downloads.dtd
+++ b/browser/locales/en-US/chrome/browser/downloads/downloads.dtd
@@ -14,19 +14,21 @@
      downloads and those of blocked downloads.
 
      A good rule of thumb is to try to determine the longest string possible
      that an in-progress download could display, and use that value in ch
      units.
 
      For example, in English, a long string would be:
 
-     59 minutes, 59 seconds remaining - 1022 of 1023 KB
+     59m 59s left - 1022 of 1023 KB (120.5 KB/sec)
 
-     That's 50 characters, so we set the width at 50ch.
+     Since Downloads Panel is redesigned to show the detail string including
+     the hovering case for an item or an action button.
+     Bug 1328519 is for discussing the detail rule of `downloadDetails.width`.
      -->
 <!ENTITY downloadDetails.width            "50ch">
 
 <!-- LOCALIZATION NOTE (downloadsSummary.minWidth2):
      Minimum width for the main description of the downloads summary,
      which is displayed at the bottom of the Downloads Panel if the
      number of downloads exceeds the limit that the panel can display.
 
--- a/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties
+++ b/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties
@@ -1,18 +1,20 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # LOCALIZATION NOTE (seconds, minutes, hours, days): Semi-colon list of plural
 # forms. See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
-seconds=second;seconds
-minutes=minute;minutes
-hours=hour;hours
-days=day;days
+# Short version of seconds, minutes, hours, and days if needed. The plural form
+# is still used here to fulfill the different language.
+shortSeconds=s;s
+shortMinutes=m;m
+shortHours=h;h
+shortDays=d;d
 
 # LOCALIZATION NOTE (paused): — is the "em dash" (long dash)
 paused=Paused —  #1
 downloading=Downloading
 notStarted=Not Started
 failed=Failed
 finished=Finished
 canceled=Canceled
@@ -73,27 +75,27 @@ transferSameUnits2=%1$S of %2$S %3$S
 # %1$S progress number; %2$S progress unit; %3$S total number; %4$S total unit
 # example: 11.1 MB of 3.3 GB
 transferDiffUnits2=%1$S %2$S of %3$S %4$S
 # LOCALIZATION NOTE (transferNoTotal2):
 # %1$S progress number; %2$S unit
 # example: 111 KB
 transferNoTotal2=%1$S %2$S
 
-# LOCALIZATION NOTE (timePair2): %1$S time number; %2$S time unit
-# example: 1 minute; 11 hours
-timePair2=%1$S %2$S
-# LOCALIZATION NOTE (timeLeftSingle2): %1$S time left
-# example: 1 minute remaining; 11 hours remaining
-timeLeftSingle2=%1$S remaining
-# LOCALIZATION NOTE (timeLeftDouble2): %1$S time left; %2$S time left sub units
-# example: 11 hours, 2 minutes remaining; 1 day, 22 hours remaining
-timeLeftDouble2=%1$S, %2$S remaining
-timeFewSeconds=A few seconds remaining
-timeUnknown=Unknown time remaining
+# LOCALIZATION NOTE (timePair3): %1$S time number; %2$S time unit
+# example: 1m; 11h
+timePair3=%1$S%2$S
+# LOCALIZATION NOTE (timeLeftSingle3): %1$S time left
+# example: 1m left; 11h left
+timeLeftSingle3=%1$S left
+# LOCALIZATION NOTE (timeLeftDouble3): %1$S time left; %2$S time left sub units
+# example: 11h 2m left; 1d 22h left
+timeLeftDouble3=%1$S %2$S left
+timeFewSeconds2=A few seconds left
+timeUnknown2=Unknown time left
 
 # LOCALIZATION NOTE (doneSize): #1 size number; #2 size unit
 doneSize=#1 #2
 # LOCALIZATION NOTE (doneScheme): #1 URI scheme like data: jar: about:
 doneScheme2=%1$S resource
 # LOCALIZATION NOTE (doneFileScheme): Special case of doneScheme for file:
 # This is used as an eTLD replacement for local files, so make it lower case
 doneFileScheme=local file
--- a/toolkit/mozapps/downloads/DownloadUtils.jsm
+++ b/toolkit/mozapps/downloads/DownloadUtils.jsm
@@ -71,28 +71,28 @@ const kDownloadProperties =
 
 var gStr = {
   statusFormat: "statusFormat3",
   statusFormatInfiniteRate: "statusFormatInfiniteRate",
   statusFormatNoRate: "statusFormatNoRate",
   transferSameUnits: "transferSameUnits2",
   transferDiffUnits: "transferDiffUnits2",
   transferNoTotal: "transferNoTotal2",
-  timePair: "timePair2",
-  timeLeftSingle: "timeLeftSingle2",
-  timeLeftDouble: "timeLeftDouble2",
-  timeFewSeconds: "timeFewSeconds",
-  timeUnknown: "timeUnknown",
+  timePair: "timePair3",
+  timeLeftSingle: "timeLeftSingle3",
+  timeLeftDouble: "timeLeftDouble3",
+  timeFewSeconds: "timeFewSeconds2",
+  timeUnknown: "timeUnknown2",
   monthDate: "monthDate2",
   yesterday: "yesterday",
   doneScheme: "doneScheme2",
   doneFileScheme: "doneFileScheme",
   units: ["bytes", "kilobyte", "megabyte", "gigabyte"],
   // Update timeSize in convertTimeUnits if changing the length of this array
-  timeUnits: ["seconds", "minutes", "hours", "days"],
+  timeUnits: ["shortSeconds", "shortMinutes", "shortHours", "shortDays"],
   infiniteRate: "infiniteRate",
 };
 
 // This lazily initializes the string bundle upon first use.
 this.__defineGetter__("gBundle", function() {
   delete this.gBundle;
   return this.gBundle = Cc["@mozilla.org/intl/stringbundle;1"].
                         getService(Ci.nsIStringBundleService).
--- a/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
@@ -17,17 +17,17 @@ function testConvertByteUnits(aBytes, aV
 }
 
 function testTransferTotal(aCurrBytes, aMaxBytes, aTransfer) {
   let transfer = DownloadUtils.getTransferTotal(aCurrBytes, aMaxBytes);
   do_check_eq(transfer, aTransfer);
 }
 
 // Get the em-dash character because typing it directly here doesn't work :(
-var gDash = DownloadUtils.getDownloadStatus(0)[0].match(/remaining (.) 0 bytes/)[1];
+var gDash = DownloadUtils.getDownloadStatus(0)[0].match(/left (.) 0 bytes/)[1];
 
 var gVals = [0, 100, 2345, 55555, 982341, 23194134, 1482, 58, 9921949201, 13498132, Infinity];
 
 function testStatus(aFunc, aCurr, aMore, aRate, aTest) {
   dump("Status Test: " + [aCurr, aMore, aRate, aTest] + "\n");
   let curr = gVals[aCurr];
   let max = curr + gVals[aMore];
   let speed = gVals[aRate];
@@ -141,82 +141,82 @@ function run_test() {
     for (let i = 0; i < 100; i++) {
       testStatus(r(), r(), r());
     }
   }
 
   // First, test with rates, via getDownloadStatus...
   let statusFunc = DownloadUtils.getDownloadStatus.bind(DownloadUtils);
 
-  testStatus(statusFunc, 2, 1, 7, ["A few seconds remaining -- 2.3 of 2.4 KB (58 bytes/sec)", 1.724]);
-  testStatus(statusFunc, 1, 2, 6, ["A few seconds remaining -- 100 bytes of 2.4 KB (1.4 KB/sec)", 1.582]);
-  testStatus(statusFunc, 4, 3, 9, ["A few seconds remaining -- 959 KB of 1.0 MB (12.9 MB/sec)", 0.004]);
-  testStatus(statusFunc, 2, 3, 8, ["A few seconds remaining -- 2.3 of 56.5 KB (9.2 GB/sec)", 0.000]);
+  testStatus(statusFunc, 2, 1, 7, ["A few seconds left -- 2.3 of 2.4 KB (58 bytes/sec)", 1.724]);
+  testStatus(statusFunc, 1, 2, 6, ["A few seconds left -- 100 bytes of 2.4 KB (1.4 KB/sec)", 1.582]);
+  testStatus(statusFunc, 4, 3, 9, ["A few seconds left -- 959 KB of 1.0 MB (12.9 MB/sec)", 0.004]);
+  testStatus(statusFunc, 2, 3, 8, ["A few seconds left -- 2.3 of 56.5 KB (9.2 GB/sec)", 0.000]);
 
-  testStatus(statusFunc, 8, 4, 3, ["17 seconds remaining -- 9.2 of 9.2 GB (54.3 KB/sec)", 17.682]);
-  testStatus(statusFunc, 1, 3, 2, ["23 seconds remaining -- 100 bytes of 54.4 KB (2.3 KB/sec)", 23.691]);
-  testStatus(statusFunc, 9, 3, 2, ["23 seconds remaining -- 12.9 of 12.9 MB (2.3 KB/sec)", 23.691]);
-  testStatus(statusFunc, 5, 6, 7, ["25 seconds remaining -- 22.1 of 22.1 MB (58 bytes/sec)", 25.552]);
+  testStatus(statusFunc, 8, 4, 3, ["17s left -- 9.2 of 9.2 GB (54.3 KB/sec)", 17.682]);
+  testStatus(statusFunc, 1, 3, 2, ["23s left -- 100 bytes of 54.4 KB (2.3 KB/sec)", 23.691]);
+  testStatus(statusFunc, 9, 3, 2, ["23s left -- 12.9 of 12.9 MB (2.3 KB/sec)", 23.691]);
+  testStatus(statusFunc, 5, 6, 7, ["25s left -- 22.1 of 22.1 MB (58 bytes/sec)", 25.552]);
 
-  testStatus(statusFunc, 3, 9, 3, ["4 minutes remaining -- 54.3 KB of 12.9 MB (54.3 KB/sec)", 242.969]);
-  testStatus(statusFunc, 2, 3, 1, ["9 minutes remaining -- 2.3 of 56.5 KB (100 bytes/sec)", 555.550]);
-  testStatus(statusFunc, 4, 3, 7, ["15 minutes remaining -- 959 KB of 1.0 MB (58 bytes/sec)", 957.845]);
-  testStatus(statusFunc, 5, 3, 7, ["15 minutes remaining -- 22.1 of 22.2 MB (58 bytes/sec)", 957.845]);
+  testStatus(statusFunc, 3, 9, 3, ["4m left -- 54.3 KB of 12.9 MB (54.3 KB/sec)", 242.969]);
+  testStatus(statusFunc, 2, 3, 1, ["9m left -- 2.3 of 56.5 KB (100 bytes/sec)", 555.550]);
+  testStatus(statusFunc, 4, 3, 7, ["15m left -- 959 KB of 1.0 MB (58 bytes/sec)", 957.845]);
+  testStatus(statusFunc, 5, 3, 7, ["15m left -- 22.1 of 22.2 MB (58 bytes/sec)", 957.845]);
 
-  testStatus(statusFunc, 1, 9, 2, ["1 hour, 35 minutes remaining -- 100 bytes of 12.9 MB (2.3 KB/sec)", 5756.133]);
-  testStatus(statusFunc, 2, 9, 6, ["2 hours, 31 minutes remaining -- 2.3 KB of 12.9 MB (1.4 KB/sec)", 9108.051]);
-  testStatus(statusFunc, 2, 4, 1, ["2 hours, 43 minutes remaining -- 2.3 of 962 KB (100 bytes/sec)", 9823.410]);
-  testStatus(statusFunc, 6, 4, 7, ["4 hours, 42 minutes remaining -- 1.4 of 961 KB (58 bytes/sec)", 16936.914]);
+  testStatus(statusFunc, 1, 9, 2, ["1h 35m left -- 100 bytes of 12.9 MB (2.3 KB/sec)", 5756.133]);
+  testStatus(statusFunc, 2, 9, 6, ["2h 31m left -- 2.3 KB of 12.9 MB (1.4 KB/sec)", 9108.051]);
+  testStatus(statusFunc, 2, 4, 1, ["2h 43m left -- 2.3 of 962 KB (100 bytes/sec)", 9823.410]);
+  testStatus(statusFunc, 6, 4, 7, ["4h 42m left -- 1.4 of 961 KB (58 bytes/sec)", 16936.914]);
 
-  testStatus(statusFunc, 6, 9, 1, ["1 day, 13 hours remaining -- 1.4 KB of 12.9 MB (100 bytes/sec)", 134981.320]);
-  testStatus(statusFunc, 3, 8, 3, ["2 days, 1 hour remaining -- 54.3 KB of 9.2 GB (54.3 KB/sec)", 178596.872]);
-  testStatus(statusFunc, 1, 8, 6, ["77 days, 11 hours remaining -- 100 bytes of 9.2 GB (1.4 KB/sec)", 6694972.470]);
-  testStatus(statusFunc, 6, 8, 7, ["1979 days, 22 hours remaining -- 1.4 KB of 9.2 GB (58 bytes/sec)", 171068089.672]);
+  testStatus(statusFunc, 6, 9, 1, ["1d 13h left -- 1.4 KB of 12.9 MB (100 bytes/sec)", 134981.320]);
+  testStatus(statusFunc, 3, 8, 3, ["2d 1h left -- 54.3 KB of 9.2 GB (54.3 KB/sec)", 178596.872]);
+  testStatus(statusFunc, 1, 8, 6, ["77d 11h left -- 100 bytes of 9.2 GB (1.4 KB/sec)", 6694972.470]);
+  testStatus(statusFunc, 6, 8, 7, ["1979d 22h left -- 1.4 KB of 9.2 GB (58 bytes/sec)", 171068089.672]);
 
-  testStatus(statusFunc, 0, 0, 5, ["Unknown time remaining -- 0 of 0 bytes (22.1 MB/sec)", Infinity]);
-  testStatus(statusFunc, 0, 6, 0, ["Unknown time remaining -- 0 bytes of 1.4 KB (0 bytes/sec)", Infinity]);
-  testStatus(statusFunc, 6, 6, 0, ["Unknown time remaining -- 1.4 of 2.9 KB (0 bytes/sec)", Infinity]);
-  testStatus(statusFunc, 8, 5, 0, ["Unknown time remaining -- 9.2 of 9.3 GB (0 bytes/sec)", Infinity]);
+  testStatus(statusFunc, 0, 0, 5, ["Unknown time left -- 0 of 0 bytes (22.1 MB/sec)", Infinity]);
+  testStatus(statusFunc, 0, 6, 0, ["Unknown time left -- 0 bytes of 1.4 KB (0 bytes/sec)", Infinity]);
+  testStatus(statusFunc, 6, 6, 0, ["Unknown time left -- 1.4 of 2.9 KB (0 bytes/sec)", Infinity]);
+  testStatus(statusFunc, 8, 5, 0, ["Unknown time left -- 9.2 of 9.3 GB (0 bytes/sec)", Infinity]);
 
   // With rate equal to Infinity
-  testStatus(statusFunc, 0, 0, 10, ["Unknown time remaining -- 0 of 0 bytes (Really fast)", Infinity]);
-  testStatus(statusFunc, 1, 2, 10, ["A few seconds remaining -- 100 bytes of 2.4 KB (Really fast)", 0]);
+  testStatus(statusFunc, 0, 0, 10, ["Unknown time left -- 0 of 0 bytes (Really fast)", Infinity]);
+  testStatus(statusFunc, 1, 2, 10, ["A few seconds left -- 100 bytes of 2.4 KB (Really fast)", 0]);
 
   // Now test without rates, via getDownloadStatusNoRate.
   statusFunc = DownloadUtils.getDownloadStatusNoRate.bind(DownloadUtils);
 
-  testStatus(statusFunc, 2, 1, 7, ["A few seconds remaining -- 2.3 of 2.4 KB", 1.724]);
-  testStatus(statusFunc, 1, 2, 6, ["A few seconds remaining -- 100 bytes of 2.4 KB", 1.582]);
-  testStatus(statusFunc, 4, 3, 9, ["A few seconds remaining -- 959 KB of 1.0 MB", 0.004]);
-  testStatus(statusFunc, 2, 3, 8, ["A few seconds remaining -- 2.3 of 56.5 KB", 0.000]);
+  testStatus(statusFunc, 2, 1, 7, ["A few seconds left -- 2.3 of 2.4 KB", 1.724]);
+  testStatus(statusFunc, 1, 2, 6, ["A few seconds left -- 100 bytes of 2.4 KB", 1.582]);
+  testStatus(statusFunc, 4, 3, 9, ["A few seconds left -- 959 KB of 1.0 MB", 0.004]);
+  testStatus(statusFunc, 2, 3, 8, ["A few seconds left -- 2.3 of 56.5 KB", 0.000]);
 
-  testStatus(statusFunc, 8, 4, 3, ["17 seconds remaining -- 9.2 of 9.2 GB", 17.682]);
-  testStatus(statusFunc, 1, 3, 2, ["23 seconds remaining -- 100 bytes of 54.4 KB", 23.691]);
-  testStatus(statusFunc, 9, 3, 2, ["23 seconds remaining -- 12.9 of 12.9 MB", 23.691]);
-  testStatus(statusFunc, 5, 6, 7, ["25 seconds remaining -- 22.1 of 22.1 MB", 25.552]);
+  testStatus(statusFunc, 8, 4, 3, ["17s left -- 9.2 of 9.2 GB", 17.682]);
+  testStatus(statusFunc, 1, 3, 2, ["23s left -- 100 bytes of 54.4 KB", 23.691]);
+  testStatus(statusFunc, 9, 3, 2, ["23s left -- 12.9 of 12.9 MB", 23.691]);
+  testStatus(statusFunc, 5, 6, 7, ["25s left -- 22.1 of 22.1 MB", 25.552]);
 
-  testStatus(statusFunc, 3, 9, 3, ["4 minutes remaining -- 54.3 KB of 12.9 MB", 242.969]);
-  testStatus(statusFunc, 2, 3, 1, ["9 minutes remaining -- 2.3 of 56.5 KB", 555.550]);
-  testStatus(statusFunc, 4, 3, 7, ["15 minutes remaining -- 959 KB of 1.0 MB", 957.845]);
-  testStatus(statusFunc, 5, 3, 7, ["15 minutes remaining -- 22.1 of 22.2 MB", 957.845]);
+  testStatus(statusFunc, 3, 9, 3, ["4m left -- 54.3 KB of 12.9 MB", 242.969]);
+  testStatus(statusFunc, 2, 3, 1, ["9m left -- 2.3 of 56.5 KB", 555.550]);
+  testStatus(statusFunc, 4, 3, 7, ["15m left -- 959 KB of 1.0 MB", 957.845]);
+  testStatus(statusFunc, 5, 3, 7, ["15m left -- 22.1 of 22.2 MB", 957.845]);
 
-  testStatus(statusFunc, 1, 9, 2, ["1 hour, 35 minutes remaining -- 100 bytes of 12.9 MB", 5756.133]);
-  testStatus(statusFunc, 2, 9, 6, ["2 hours, 31 minutes remaining -- 2.3 KB of 12.9 MB", 9108.051]);
-  testStatus(statusFunc, 2, 4, 1, ["2 hours, 43 minutes remaining -- 2.3 of 962 KB", 9823.410]);
-  testStatus(statusFunc, 6, 4, 7, ["4 hours, 42 minutes remaining -- 1.4 of 961 KB", 16936.914]);
+  testStatus(statusFunc, 1, 9, 2, ["1h 35m left -- 100 bytes of 12.9 MB", 5756.133]);
+  testStatus(statusFunc, 2, 9, 6, ["2h 31m left -- 2.3 KB of 12.9 MB", 9108.051]);
+  testStatus(statusFunc, 2, 4, 1, ["2h 43m left -- 2.3 of 962 KB", 9823.410]);
+  testStatus(statusFunc, 6, 4, 7, ["4h 42m left -- 1.4 of 961 KB", 16936.914]);
 
-  testStatus(statusFunc, 6, 9, 1, ["1 day, 13 hours remaining -- 1.4 KB of 12.9 MB", 134981.320]);
-  testStatus(statusFunc, 3, 8, 3, ["2 days, 1 hour remaining -- 54.3 KB of 9.2 GB", 178596.872]);
-  testStatus(statusFunc, 1, 8, 6, ["77 days, 11 hours remaining -- 100 bytes of 9.2 GB", 6694972.470]);
-  testStatus(statusFunc, 6, 8, 7, ["1979 days, 22 hours remaining -- 1.4 KB of 9.2 GB", 171068089.672]);
+  testStatus(statusFunc, 6, 9, 1, ["1d 13h left -- 1.4 KB of 12.9 MB", 134981.320]);
+  testStatus(statusFunc, 3, 8, 3, ["2d 1h left -- 54.3 KB of 9.2 GB", 178596.872]);
+  testStatus(statusFunc, 1, 8, 6, ["77d 11h left -- 100 bytes of 9.2 GB", 6694972.470]);
+  testStatus(statusFunc, 6, 8, 7, ["1979d 22h left -- 1.4 KB of 9.2 GB", 171068089.672]);
 
-  testStatus(statusFunc, 0, 0, 5, ["Unknown time remaining -- 0 of 0 bytes", Infinity]);
-  testStatus(statusFunc, 0, 6, 0, ["Unknown time remaining -- 0 bytes of 1.4 KB", Infinity]);
-  testStatus(statusFunc, 6, 6, 0, ["Unknown time remaining -- 1.4 of 2.9 KB", Infinity]);
-  testStatus(statusFunc, 8, 5, 0, ["Unknown time remaining -- 9.2 of 9.3 GB", Infinity]);
+  testStatus(statusFunc, 0, 0, 5, ["Unknown time left -- 0 of 0 bytes", Infinity]);
+  testStatus(statusFunc, 0, 6, 0, ["Unknown time left -- 0 bytes of 1.4 KB", Infinity]);
+  testStatus(statusFunc, 6, 6, 0, ["Unknown time left -- 1.4 of 2.9 KB", Infinity]);
+  testStatus(statusFunc, 8, 5, 0, ["Unknown time left -- 9.2 of 9.3 GB", Infinity]);
 
   testURI("http://www.mozilla.org/", "mozilla.org", "www.mozilla.org");
   testURI("http://www.city.mikasa.hokkaido.jp/", "city.mikasa.hokkaido.jp", "www.city.mikasa.hokkaido.jp");
   testURI("data:text/html,Hello World", "data resource", "data resource");
   testURI("jar:http://www.mozilla.com/file!/magic", "mozilla.com", "www.mozilla.com");
   testURI("file:///C:/Cool/Stuff/", "local file", "local file");
   // Don't test for moz-icon if we don't have a protocol handler for it (e.g. b2g):
   if ("@mozilla.org/network/protocol;1?name=moz-icon" in Components.classes) {
--- a/toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
@@ -19,28 +19,28 @@ Components.utils.import("resource://gre/
  * @usage _(1, 2, 3) -> prints "1 2 3"
  */
 var _ = function(some, debug, text, to) {
   print(Array.slice(arguments).join(" "));
 };
 
 _("Make an array of time lefts and expected string to be shown for that time");
 var expectedTimes = [
-  [1.1, "A few seconds remaining", "under 4sec -> few"],
-  [2.5, "A few seconds remaining", "under 4sec -> few"],
-  [3.9, "A few seconds remaining", "under 4sec -> few"],
-  [5.3, "5 seconds remaining", "truncate seconds"],
-  [1.1 * 60, "1 minute, 6 seconds remaining", "under 4min -> show sec"],
-  [2.5 * 60, "2 minutes, 30 seconds remaining", "under 4min -> show sec"],
-  [3.9 * 60, "3 minutes, 54 seconds remaining", "under 4min -> show sec"],
-  [5.3 * 60, "5 minutes remaining", "over 4min -> only show min"],
-  [1.1 * 3600, "1 hour, 6 minutes remaining", "over 1hr -> show min/sec"],
-  [2.5 * 3600, "2 hours, 30 minutes remaining", "over 1hr -> show min/sec"],
-  [3.9 * 3600, "3 hours, 54 minutes remaining", "over 1hr -> show min/sec"],
-  [5.3 * 3600, "5 hours, 18 minutes remaining", "over 1hr -> show min/sec"],
+  [1.1, "A few seconds left", "under 4sec -> few"],
+  [2.5, "A few seconds left", "under 4sec -> few"],
+  [3.9, "A few seconds left", "under 4sec -> few"],
+  [5.3, "5s left", "truncate seconds"],
+  [1.1 * 60, "1m 6s left", "under 4min -> show sec"],
+  [2.5 * 60, "2m 30s left", "under 4min -> show sec"],
+  [3.9 * 60, "3m 54s left", "under 4min -> show sec"],
+  [5.3 * 60, "5m left", "over 4min -> only show min"],
+  [1.1 * 3600, "1h 6m left", "over 1hr -> show min/sec"],
+  [2.5 * 3600, "2h 30m left", "over 1hr -> show min/sec"],
+  [3.9 * 3600, "3h 54m left", "over 1hr -> show min/sec"],
+  [5.3 * 3600, "5h 18m left", "over 1hr -> show min/sec"],
 ];
 _(expectedTimes.join("\n"));
 
 function run_test() {
   expectedTimes.forEach(function([time, expectStatus, comment]) {
     _("Running test with time", time);
     _("Test comment:", comment);
     let [status, last] = DownloadUtils.getTimeLeft(time);