toolkit/mozapps/extensions/test/xpcshell/test_bug465190.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4 */
michael@0 5
michael@0 6 var installLocation = gProfD.clone();
michael@0 7 installLocation.append("baddir");
michael@0 8 installLocation.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0664);
michael@0 9
michael@0 10 var dirProvider2 = {
michael@0 11 getFile: function(prop, persistent) {
michael@0 12 persistent.value = true;
michael@0 13 if (prop == "XREUSysExt")
michael@0 14 return installLocation.clone();
michael@0 15 return null;
michael@0 16 },
michael@0 17 QueryInterface: function(iid) {
michael@0 18 if (iid.equals(Components.interfaces.nsIDirectoryServiceProvider) ||
michael@0 19 iid.equals(Components.interfaces.nsISupports)) {
michael@0 20 return this;
michael@0 21 }
michael@0 22 throw Components.results.NS_ERROR_NO_INTERFACE;
michael@0 23 }
michael@0 24 };
michael@0 25 Services.dirsvc.QueryInterface(Components.interfaces.nsIDirectoryService)
michael@0 26 .registerProvider(dirProvider2);
michael@0 27
michael@0 28 function run_test()
michael@0 29 {
michael@0 30 var log = gProfD.clone();
michael@0 31 log.append("extensions.log");
michael@0 32 do_check_false(log.exists());
michael@0 33
michael@0 34 // Setup for test
michael@0 35 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1");
michael@0 36
michael@0 37 startupManager();
michael@0 38 do_check_false(log.exists());
michael@0 39 }

mercurial