diff --git a/webshell/tests/viewer/nsViewerApp.cpp b/webshell/tests/viewer/nsViewerApp.cpp index 903e9b8bdff..a0716b70f14 100644 --- a/webshell/tests/viewer/nsViewerApp.cpp +++ b/webshell/tests/viewer/nsViewerApp.cpp @@ -416,7 +416,8 @@ PrintHelpInfo(char **argv) fprintf(stderr, "-A domain -- add a domain/host that should be avoided (e.g. microsoft.com)\n"); fprintf(stderr, "-N pages -- set the max # of pages to crawl\n"); fprintf(stderr, "-x -- startup and just shutdown to test for leaks under Purify\n"); - fprintf(stderr, "-Prt -- printer test will be run\n"); + fprintf(stderr, "-Prt -- number of the printer test 1=regression, no printout \n"); + fprintf(stderr, "-B -- Setting for regression output 1=brief, 2=verbose \n"); #if defined(NS_DEBUG) && defined(XP_WIN) fprintf(stderr, "-md # -- set the crt debug flags to #\n"); #endif @@ -633,6 +634,15 @@ nsViewerApp::ProcessArguments(int argc, char** argv) else if (PL_strcmp(argv[i], "-?") == 0) { PrintHelpInfo(argv); } + else if (PL_strcmp(argv[i], "-B") == 0) { + int regressionOutput; + i++; + if (i>=argc || 1!=sscanf(argv[i], "%d", ®ressionOutput)){ + PrintHelpInfo(argv); + exit(-1); + } + mCrawler->RegressionOutput(regressionOutput); + } else if (PL_strcmp(argv[i], "-Prt") == 0) { int printTestType; i++; diff --git a/webshell/tests/viewer/nsWebCrawler.cpp b/webshell/tests/viewer/nsWebCrawler.cpp index e6e03066601..546f6a9a021 100644 --- a/webshell/tests/viewer/nsWebCrawler.cpp +++ b/webshell/tests/viewer/nsWebCrawler.cpp @@ -204,6 +204,7 @@ nsWebCrawler::nsWebCrawler(nsViewerApp* aViewer) LL_I2L(mStartLoad, 0); mRegressing = PR_FALSE; mPrinterTestType = 0; + mRegressionOutputLevel = 0; // full output mIncludeStyleInfo = PR_TRUE; mLastWebShell = nsnull; } @@ -992,7 +993,7 @@ nsWebCrawler::PerformRegressionTest(const nsString& aOutputName) NS_RELEASE(fu); return; } - rv = fu->CompareRegressionData(f1, f2); + rv = fu->CompareRegressionData(f1, f2,mRegressionOutputLevel); NS_RELEASE(fu); char dirName[BUF_SIZE]; diff --git a/webshell/tests/viewer/nsWebCrawler.h b/webshell/tests/viewer/nsWebCrawler.h index 3b202f211fe..ca7c6333b79 100644 --- a/webshell/tests/viewer/nsWebCrawler.h +++ b/webshell/tests/viewer/nsWebCrawler.h @@ -71,6 +71,8 @@ public: void SetPrintTest(PRInt32 aTestType) { mPrinterTestType = aTestType; } + void RegressionOutput(PRInt32 aRegressionOutputLevel) { mRegressionOutputLevel = aRegressionOutputLevel; } + void EnableJiggleLayout() { mJiggleLayout = PR_TRUE; } @@ -179,6 +181,7 @@ protected: PRBool mVerbose; PRBool mRegressing; PRInt32 mPrinterTestType; + PRInt32 mRegressionOutputLevel; nsString mRegressionDir; PRBool mIncludeStyleInfo;