toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:a88d204c031f
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 /**
6 * Make sure passing null and nothing to various variable-arg DownloadUtils
7 * methods provide the same result.
8 */
9
10 let Cu = Components.utils;
11 Cu.import("resource://gre/modules/DownloadUtils.jsm");
12
13 function run_test()
14 {
15 do_check_eq(DownloadUtils.getDownloadStatus(1000, null, null, null) + "",
16 DownloadUtils.getDownloadStatus(1000) + "");
17 do_check_eq(DownloadUtils.getDownloadStatus(1000, null, null) + "",
18 DownloadUtils.getDownloadStatus(1000, null) + "");
19
20 do_check_eq(DownloadUtils.getTransferTotal(1000, null) + "",
21 DownloadUtils.getTransferTotal(1000) + "");
22
23 do_check_eq(DownloadUtils.getTimeLeft(1000, null) + "",
24 DownloadUtils.getTimeLeft(1000) + "");
25 }

mercurial