bug 327065 misc necko cleanup, see bug for details

r+sr=darin
This commit is contained in:
cbiesinger%web.de 2006-02-14 15:37:10 +00:00
parent fb1d05e877
commit 5cdaeda098
7 changed files with 29 additions and 23 deletions

View File

@ -48,7 +48,7 @@
static NS_DEFINE_CID(kEventQueueService, NS_EVENTQUEUESERVICE_CID);
#if defined(PR_LOGGING)
PRLogModuleInfo* gStreamEventLog = 0;
static PRLogModuleInfo* gStreamEventLog = 0;
#endif
// prevent name conflicts

View File

@ -69,22 +69,6 @@
#define NS_NO_INPUT_BUFFERING 1 // see http://bugzilla.mozilla.org/show_bug.cgi?id=41067
#if defined(PR_LOGGING)
//
// Log module for nsFileTransport logging...
//
// To enable logging (see prlog.h for full details):
//
// set NSPR_LOG_MODULES=nsFileIO:5
// set NSPR_LOG_FILE=nspr.log
//
// this enables PR_LOG_DEBUG level information and places all output in
// the file nspr.log
//
PRLogModuleInfo* gFileIOLog = nsnull;
#endif /* PR_LOGGING */
////////////////////////////////////////////////////////////////////////////////
// nsFileStream

View File

@ -64,7 +64,7 @@
// this enables PR_LOG_DEBUG level information and places all output in
// the file nspr.log
//
PRLogModuleInfo* gLoadGroupLog = nsnull;
static PRLogModuleInfo* gLoadGroupLog = nsnull;
#endif
#define LOG(args) PR_LOG(gLoadGroupLog, PR_LOG_DEBUG, args)

View File

@ -39,6 +39,7 @@
#include "nsIndexedToHTML.h"
#include "nsNetUtil.h"
#include "netCore.h"
#include "nsStringStream.h"
#include "nsIFileURL.h"
#include "nsEscape.h"
@ -105,8 +106,7 @@ nsIndexedToHTML::Init(nsIStreamListener* aListener) {
nsCOMPtr<nsIStringBundleService> sbs =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
rv = sbs->CreateBundle("chrome://necko/locale/necko.properties",
getter_AddRefs(mBundle));
rv = sbs->CreateBundle(NECKO_MSGS_URL, getter_AddRefs(mBundle));
mExpectAbsLoc = PR_FALSE;

View File

@ -65,7 +65,9 @@ main(int argc, char **argv)
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
if (NS_FAILED(rv)) return rv;
char buf[256];
if (argc != 3) {

View File

@ -143,6 +143,19 @@ SetHttpProxy(const char *proxy)
return NS_OK;
}
static nsresult
SetPACFile(const char* pacURL)
{
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs)
{
prefs->SetCharPref("network.proxy.autoconfig_url", pacURL);
prefs->SetIntPref("network.proxy.type", 2); // PAC file
}
LOG(("connecting using PAC file %s\n", pacURL));
return NS_OK;
}
//-----------------------------------------------------------------------------
// HeaderVisitor
//-----------------------------------------------------------------------------
@ -801,7 +814,9 @@ main(int argc, char* argv[])
nsresult rv= (nsresult)-1;
if (argc < 2) {
printf("usage: %s [-verbose] [-file <name>] [-resume <startoffset> [-entityid <entityid>]] [-proxy <proxy>] [-console] <url> <url> ... \n", argv[0]);
printf("usage: %s [-verbose] [-file <name>] [-resume <startoffset>"
"[-entityid <entityid>]] [-proxy <proxy>] [-pac <pacURL>]"
"[-console] <url> <url> ... \n", argv[0]);
return -1;
}
@ -861,6 +876,11 @@ main(int argc, char* argv[])
continue;
}
if (PL_strcasecmp(argv[i], "-pac") == 0) {
SetPACFile(argv[++i]);
continue;
}
LOG(("\t%s\n", argv[i]));
rv = StartLoadingURL(argv[i]);
}

View File

@ -30,7 +30,7 @@ var listener = {
},
onStopRequest: function test_onStopR(request, ctx, status) {
if (this._iteration == 1 && Components.isSuccessCode(status))
if (this._iteration == 1)
run_test_continued();
do_test_finished();
},