From d31d2b36e68f6e59392868830bc14a8c8b342517 Mon Sep 17 00:00:00 2001 From: buster Date: Thu, 28 May 1998 21:39:40 +0000 Subject: [PATCH] added an optional # to viewer.exe command line switch -p. If a number is provided, it is used as the last sample to load when running in purify. This is useful for running just a the first sample in purify, or a small number of samples, for example. --- webshell/tests/viewer/samples/test4.html | 174 ++++++++++++++++++----- webshell/tests/viewer/winmain.cpp | 26 ++-- 2 files changed, 155 insertions(+), 45 deletions(-) diff --git a/webshell/tests/viewer/samples/test4.html b/webshell/tests/viewer/samples/test4.html index 18cfb0f0adf..467a97012d2 100644 --- a/webshell/tests/viewer/samples/test4.html +++ b/webshell/tests/viewer/samples/test4.html @@ -1,42 +1,142 @@ - -Example 4 - - + + + -

Example 4: Some simple tables.

+

+Example 4: Some simple tables.

- - - - - -
ColorMeaning
lightgreenLight green is used on cells that have a colspan
khakiKhaki is used on cells that have a rowspan
lightgreyLight grey is used on cells that have a rowspan and a colspan
+ + + -Column span table: -
Color 
- - - - -
top caption
Cell Stuff to test out table cell layout. This should be long enough.
Cell Stuff to test out table cell layout. This should be long enough.
Cell Stuff to test out table cell layout. This should be long enough.Cell
-
-Row span table, no caption: - - - - - -
bottom caption
Cell Stuff to test out table cell layout. This should be long enough.Cell
CellCell
Cell Stuff to test out table cell layout. This should be long enough.Cell
-
-Row and col span table: - - - - - -

Caption Text

Cell Stuff to test out table cell layout. This should be long enough.
Cell
Cell Stuff to test out table cell layout. This should be long enough.Cell
- - +Meaning  + + +lightgreen + +Light green is used on cells that have a colspan + + + +khaki + +Khaki is used on cells that have a rowspan + + + +lightgrey + +Light grey is used on cells that have a rowspan and a colspan + + +  + + + + + + + + + + + + + + + + + + + + + + +
Table 1 has a caption at the top.  It is defined to be 100% +of it's parent's width.
CellStuff to test out table cell layout. This should be long enough.
CellStuff to test out table cell layout. +This should be long enough.
CellStuff to test out table cell layout. This should be long enough.Cell
+  + + + + + + + + + + + + + + + + + + + + + + + + +
CellStuff to test out table cell layout. +This should be long enough.Cell
CellCell
CellStuff to test out table cell layout. This should be long enough.Cell
Table 2 has a bottom caption.  It's width is +500 pixels.
+  + + + + + + + + + + + + + + + + + + + + +
Table 3 has auto-width (no width param specified.)
CellStuff to test out table cell +layout. This should be long enough.
Cell
CellStuff to test out table cell layout. This should be long enough.3-D Text
+  + + + + + + + + + + + + + + + + + + + + +
Table 4 is the same as Table 3, but with equal column widths. 
CellStuff to test out table cell +layout. This should be long enough.
Cell
CellStuff to test out table cell layout. This should be long enough.3-D Text
+  + + diff --git a/webshell/tests/viewer/winmain.cpp b/webshell/tests/viewer/winmain.cpp index 087a2e02028..c05e727df5f 100644 --- a/webshell/tests/viewer/winmain.cpp +++ b/webshell/tests/viewer/winmain.cpp @@ -66,11 +66,12 @@ static char* class2Name = "PrintPreview"; static HANDLE gInstance, gPrevInstance; static char* startURL; static nsVoidArray* gWindows; -static PRBool gDoPurify; -static PRBool gDoQuantify; -static PRBool gLoadTestFromFile; -static PRInt32 gDelay=1; -static PRInt32 gRepeatCount=1; +static PRBool gDoPurify; // run in Purify auto mode +static PRBool gDoQuantify; // run in Quantify auto mode +static PRBool gLoadTestFromFile; // run in auto mode by pulling URLs from a file (gInputFileName) +static PRInt32 gDelay=1; // if running in an auto mode, this is the delay between URL loads +static PRInt32 gRepeatCount=1; // if running in an auto mode, this is the number of times to cycle through the input +static PRInt32 gNumSamples=9; // if running in an auto mode that uses the samples, this is the last sample to load static char gInputFileName[_MAX_PATH+1]; // Debug Robot options @@ -187,7 +188,7 @@ static DocObserver* NewObserver(nsIWebWidget* ww) void AddTestDocs(nsDocLoader* aDocLoader) { char url[500]; - for (int docnum = 0; docnum < 9; docnum++) + for (int docnum = 0; docnum < gNumSamples; docnum++) { PR_snprintf(url, 500, "%s/test%d.html", SAMPLES_BASE_URL, docnum); aDocLoader->AddURL(url); @@ -870,7 +871,7 @@ BOOL CreateRobotDialog(HWND hParent) void PrintHelpInfo(char **argv) { fprintf(stderr, "Usage: %s [-p][-q][-md #][-f filename][-d #] [starting url]\n", argv[0]); - fprintf(stderr, "\t-p -- run purify\n"); + fprintf(stderr, "\t-p[#] -- run purify, optionally with a # that says which sample to stop at. For example, -p2 says to run samples 0, 1, and 2.\n"); fprintf(stderr, "\t-q -- run quantify\n"); fprintf(stderr, "\t-md # -- set the crt debug flags to #\n"); fprintf(stderr, "\t-d # -- set the delay between URL loads to # (in milliseconds)\n"); @@ -882,8 +883,17 @@ void main(int argc, char **argv) { for (int i = 1; i < argc; i++) { if (argv[i][0] == '-') { - if (strcmp(argv[i], "-p") == 0) { + if (strncmp(argv[i], "-p", 2) == 0) { gDoPurify = PR_TRUE; + char *optionalSampleStopIndex = &(argv[i][2]); + if (nsnull!=*optionalSampleStopIndex) + { + if (1!=sscanf(optionalSampleStopIndex, "%d", &gNumSamples)) + { + PrintHelpInfo(argv); + exit(-1); + } + } } else if (strcmp(argv[i], "-q") == 0) { gDoQuantify = PR_TRUE;