michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: const Cc = Components.classes; michael@0: const Ci = Components.interfaces; michael@0: const Cu = Components.utils; michael@0: michael@0: var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); michael@0: var profileDir = do_get_profile(); michael@0: michael@0: /** michael@0: * Removes any files that could make our tests fail. michael@0: */ michael@0: function cleanUp() michael@0: { michael@0: let files = [ michael@0: "downloads.sqlite", michael@0: "places.sqlite", michael@0: "cookies.sqlite", michael@0: "signons.sqlite", michael@0: "permissions.sqlite" michael@0: ]; michael@0: michael@0: for (let i = 0; i < files.length; i++) { michael@0: let file = dirSvc.get("ProfD", Ci.nsIFile); michael@0: file.append(files[i]); michael@0: if (file.exists()) michael@0: file.remove(false); michael@0: } michael@0: } michael@0: cleanUp(); michael@0: michael@0: function oldDownloadManagerDisabled() michael@0: { michael@0: try { michael@0: // This method throws an exception if the old Download Manager is disabled. michael@0: Services.downloads.activeDownloadCount; michael@0: } catch (ex) { michael@0: return true; michael@0: } michael@0: return false; michael@0: }