diff -r 000000000000 -r 6474c204b198 toolkit/components/downloads/test/unit/test_bug_384744.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolkit/components/downloads/test/unit/test_bug_384744.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,17 @@ +/* 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/. */ + +// This file tests Bug 384744 - or specifically that createInstance won't cause +// a failure with the download manager. The old practice was bad because if +// someone called createInstance before anyone called getService, getService +// would fail, and we would have a non-functional download manager. + +function run_test() +{ + var dmci = Cc["@mozilla.org/download-manager;1"]. + createInstance(Ci.nsIDownloadManager); + var dmgs = Cc["@mozilla.org/download-manager;1"]. + getService(Ci.nsIDownloadManager); + do_check_eq(dmci, dmgs); +}