make necko tests work on the trunk

This commit is contained in:
darin%meer.net 2004-10-21 20:57:17 +00:00
parent 58df7c52ab
commit 12c8f2c34a
22 changed files with 90 additions and 2 deletions

View File

@ -84,8 +84,11 @@ LIBS = $(EXTRA_DSO_LIBS) \
$(MOZ_JS_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)
DEFINES += $(TK_CFLAGS)
include $(topsrcdir)/config/rules.mk
_RES_FILES = urlparse.dat \

View File

@ -36,6 +36,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsXPCOM.h"
#include "nsString.h"
#include "nsIEventQueueService.h"
@ -63,6 +64,9 @@ static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult ret;

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsIComponentRegistrar.h"
#include "nsISocketTransportService.h"
#include "nsISocketTransport.h"
@ -120,6 +121,9 @@ RunBlockingTest(const nsACString &host, PRInt32 port, nsIFile *file)
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
if (argc < 4) {

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include <stdio.h>
#ifdef WIN32
#include <windows.h>
@ -240,6 +241,9 @@ Consumer::Validate(nsIRequest* request, nsISupports *aContext) {
nsresult StartLoad(const char *);
int main(int argc, char *argv[]) {
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv = NS_OK;
PRBool cmdLineURL = PR_FALSE;

View File

@ -36,6 +36,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsIServiceManager.h"
#include "nsICookieService.h"
#include <stdio.h>
@ -168,6 +169,9 @@ InitPrefs(nsIPrefBranch *aPrefBranch)
int
main(PRInt32 argc, char *argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv0 = NS_InitXPCOM2(nsnull, nsnull, nsnull);
if (NS_FAILED(rv0)) return -1;

View File

@ -34,6 +34,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include <stdio.h>
#include <stdlib.h>
#include "nsIServiceManager.h"
@ -88,6 +89,9 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(myDNSListener, nsIDNSListener)
int main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
int sleepLen = 10; // default: 10 seconds
if (argc == 1) {

View File

@ -37,6 +37,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include <stdio.h>
#include "nsIIDNService.h"
#include "nsCOMPtr.h"
@ -45,6 +46,9 @@
#include "nsString.h"
int main(int argc, char **argv) {
if (test_common_init(&argc, &argv) != 0)
return -1;
// Test case from RFC 3492 (7.1 - Simplified Chinese)
const char plain[] =
"\xE4\xBB\x96\xE4\xBB\xAC\xE4\xB8\xBA\xE4\xBB\x80\xE4\xB9\x88\xE4\xB8\x8D\xE8\xAF\xB4\xE4\xB8\xAD\xE6\x96\x87";

View File

@ -34,6 +34,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsIServiceManager.h"
#include "nsIEventTarget.h"
#include "nsCOMPtr.h"
@ -77,8 +78,11 @@ static nsresult RunTest()
return rv;
}
int main()
int main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
#if defined(PR_LOGGING)

View File

@ -36,6 +36,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsIURI.h"
@ -61,6 +62,9 @@
int
main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
char buf[256];

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsNetUtil.h"
#include "nsIEventQueueService.h"
#include "nsIServiceManager.h"
@ -345,7 +346,10 @@ nsresult auxLoad(char *uriBuf)
//---------MAIN-----------
int main(int argc, char **argv)
{
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
if (argc == 1) {

View File

@ -1,3 +1,4 @@
#include "TestCommon.h"
#include <stdio.h>
#include "nsCRT.h" /* should be "plstr.h"? */
#include "nsNetUtil.h"
@ -217,6 +218,9 @@ print_usage()
int
main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
PRBool sync;

View File

@ -44,6 +44,8 @@
-Gagan Saksena 04/29/99
*/
#include "TestCommon.h"
#define FORCE_PR_LOG
#include <stdio.h>
#ifdef WIN32
@ -730,6 +732,9 @@ nsresult LoadURLFromConsole()
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
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]);

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include <stdlib.h>
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
@ -144,6 +145,9 @@ MakeServer(PRInt32 port)
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv= (nsresult)-1;
if (argc < 2) {
printf("usage: %s <port>\n", argv[0]);

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsIComponentRegistrar.h"
#include "nsISocketTransportService.h"
#include "nsISocketTransport.h"
@ -280,6 +281,9 @@ RunTest(nsISocketTransportService *sts,
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
if (argc < 4) {

View File

@ -1,3 +1,4 @@
#include "TestCommon.h"
#include <stdlib.h>
#include "nsCOMPtr.h"
#include "nsIServiceManager.h"
@ -85,6 +86,9 @@ static void ref_test()
int main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
if (argc < 2) {
printf("usage: TestURL url [count]\n");
return -1;

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsIComponentRegistrar.h"
#include "nsIStreamTransportService.h"
#include "nsIAsyncInputStream.h"
@ -244,6 +245,9 @@ RunTest(nsIFile *file)
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
if (argc < 2) {

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include "TestCommon.h"
#include "nsNetUtil.h"
#include "nsEventQueueUtils.h"
#include "prlog.h"
@ -42,6 +43,9 @@ MyStreamLoaderObserver::OnStreamComplete(nsIStreamLoader *loader,
int main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
if (argc < 2) {
printf("usage: %s <url>\n", argv[0]);
return -1;

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsIComponentRegistrar.h"
#include "nsIStreamTransportService.h"
#include "nsIAsyncInputStream.h"
@ -202,6 +203,9 @@ RunTest(nsIFile *file, PRInt32 offset, PRInt32 length)
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
if (argc < 4) {

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#include "nsIComponentRegistrar.h"
#include "nsIStreamTransportService.h"
#include "nsIAsyncInputStream.h"
@ -335,6 +336,9 @@ RunBlockingTest(nsIFile *srcFile, nsIFile *destFile)
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
if (argc < 2) {

View File

@ -1,3 +1,4 @@
#include "TestCommon.h"
#include <stdio.h>
#include "nsIURLParser.h"
#include "nsCOMPtr.h"
@ -87,6 +88,9 @@ parse_path(nsIURLParser *urlParser, char *path, PRInt32 pathLen)
int
main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
if (argc < 2) {
printf("usage: TestURLParser [-std|-noauth|-auth] <url>\n");
return -1;

View File

@ -35,6 +35,7 @@
*
* ***** END LICENSE BLOCK ***** */
#include "TestCommon.h"
#ifdef WIN32
#include <windows.h>
#endif
@ -133,6 +134,9 @@ InputTestConsumer::OnStopRequest(nsIRequest *request, nsISupports* context,
int
main(int argc, char* argv[])
{
if (test_common_init(&argc, &argv) != 0)
return -1;
nsresult rv;
if (argc < 2) {

View File

@ -43,6 +43,7 @@
#include <stdio.h>
#include "TestCommon.h"
#include "plstr.h"
#include "nsIServiceManager.h"
#include "nsIIOService.h"
@ -410,6 +411,9 @@ void printusage(void)
int main(int argc, char **argv)
{
if (test_common_init(&argc, &argv) != 0)
return -1;
int rv = -1;
if (argc < 2) {