1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug465190.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 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 + 1.9 +var installLocation = gProfD.clone(); 1.10 +installLocation.append("baddir"); 1.11 +installLocation.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0664); 1.12 + 1.13 +var dirProvider2 = { 1.14 + getFile: function(prop, persistent) { 1.15 + persistent.value = true; 1.16 + if (prop == "XREUSysExt") 1.17 + return installLocation.clone(); 1.18 + return null; 1.19 + }, 1.20 + QueryInterface: function(iid) { 1.21 + if (iid.equals(Components.interfaces.nsIDirectoryServiceProvider) || 1.22 + iid.equals(Components.interfaces.nsISupports)) { 1.23 + return this; 1.24 + } 1.25 + throw Components.results.NS_ERROR_NO_INTERFACE; 1.26 + } 1.27 +}; 1.28 +Services.dirsvc.QueryInterface(Components.interfaces.nsIDirectoryService) 1.29 + .registerProvider(dirProvider2); 1.30 + 1.31 +function run_test() 1.32 +{ 1.33 + var log = gProfD.clone(); 1.34 + log.append("extensions.log"); 1.35 + do_check_false(log.exists()); 1.36 + 1.37 + // Setup for test 1.38 + createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1"); 1.39 + 1.40 + startupManager(); 1.41 + do_check_false(log.exists()); 1.42 +}