1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/downloads/test/unit/test_bug_384744.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,17 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +// This file tests Bug 384744 - or specifically that createInstance won't cause 1.9 +// a failure with the download manager. The old practice was bad because if 1.10 +// someone called createInstance before anyone called getService, getService 1.11 +// would fail, and we would have a non-functional download manager. 1.12 + 1.13 +function run_test() 1.14 +{ 1.15 + var dmci = Cc["@mozilla.org/download-manager;1"]. 1.16 + createInstance(Ci.nsIDownloadManager); 1.17 + var dmgs = Cc["@mozilla.org/download-manager;1"]. 1.18 + getService(Ci.nsIDownloadManager); 1.19 + do_check_eq(dmci, dmgs); 1.20 +}