Backing out Bug 410156 due to test bustage

This commit is contained in:
rob_strong@exchangecode.com 2008-04-17 16:05:06 -07:00
Родитель 885fcb1efa
Коммит e7ddfe22b5
2 изменённых файлов: 5 добавлений и 39 удалений

Просмотреть файл

@ -95,7 +95,6 @@ protected:
void *aClosure);
void appendArg(const char* arg);
void resolveShortcutURL(nsILocalFile* aFile, nsACString& outURL);
nsresult EnumerateHandlers(EnumerateHandlersCallback aCallback, void *aClosure);
nsresult EnumerateValidators(EnumerateValidatorsCallback aCallback, void *aClosure);
@ -443,28 +442,18 @@ nsCommandLine::ResolveURI(const nsAString& aArgument, nsIURI* *aResult)
nsCOMPtr<nsIIOService> io = do_GetIOService();
NS_ENSURE_TRUE(io, NS_ERROR_OUT_OF_MEMORY);
nsCOMPtr<nsIURI> workingDirURI;
if (mWorkingDir) {
io->NewFileURI(mWorkingDir, getter_AddRefs(workingDirURI));
}
nsCOMPtr<nsILocalFile> lf (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
rv = lf->InitWithPath(aArgument);
if (NS_SUCCEEDED(rv)) {
lf->Normalize();
nsCAutoString url;
// Try to resolve the url for .url files.
resolveShortcutURL(lf, url);
if (!url.IsEmpty()) {
return io->NewURI(url,
nsnull,
workingDirURI,
aResult);
}
return io->NewFileURI(lf, aResult);
}
nsCOMPtr<nsIURI> workingDirURI;
if (mWorkingDir) {
io->NewFileURI(mWorkingDir, getter_AddRefs(workingDirURI));
}
return io->NewURI(NS_ConvertUTF16toUTF8(aArgument),
nsnull,
workingDirURI,
@ -488,22 +477,6 @@ nsCommandLine::appendArg(const char* arg)
mArgs.AppendString(warg);
}
void
nsCommandLine::resolveShortcutURL(nsILocalFile* aFile, nsACString& outURL)
{
nsCOMPtr<nsIFileProtocolHandler> fph;
nsresult rv = NS_GetFileProtocolHandler(getter_AddRefs(fph));
if (NS_FAILED(rv))
return;
nsCOMPtr<nsIURI> uri;
rv = fph->ReadURLFile(aFile, getter_AddRefs(uri));
if (NS_FAILED(rv))
return;
uri->GetSpec(outURL);
}
NS_IMETHODIMP
nsCommandLine::Init(PRInt32 argc, char** argv, nsIFile* aWorkingDir,
PRUint32 aState)

Просмотреть файл

@ -45,16 +45,9 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = test_harness_commandlines
TESTROOT = $(shell cd $(DEPTH) && pwd)/_tests/xpcshell-simple/$(MODULE)
XPCSHELL_TESTS = \
unit \
$(NULL)
include $(topsrcdir)/config/rules.mk
ifneq (,$(filter-out OS2 Darwin,$(OS_ARCH)))
# Hack to allow preprocessing of test_bug410156.js
libs:: unit/test_bug410156.js.in
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ > $(TESTROOT)/unit/test_bug410156.js
endif