Commit 91bbfdc6 authored by eseidel's avatar eseidel

Bug #: none

Submitted by: eseidel
Reviewed by: mjs
        Move WebView width/height logic into DumpRenderTree to support
        running the W3C SVG 1.1 tests along side other tests.  The W3C
        SVG 1.1 tests require a 480x360 view.

        * DumpRenderTree/DumpRenderTree.m:
        (main): don't accept width/height
        (dump): override width/height for SVG/W3C
        * Scripts/run-webkit-tests: don't pass width/height


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c230576d
2005-12-30 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
Move WebView width/height logic into DumpRenderTree to support
running the W3C SVG 1.1 tests along side other tests. The W3C
SVG 1.1 tests require a 480x360 view.
* DumpRenderTree/DumpRenderTree.m:
(main): don't accept width/height
(dump): override width/height for SVG/W3C
* Scripts/run-webkit-tests: don't pass width/height
2005-12-30 Eric Seidel <eseidel@apple.com>
No review, only removing dead code.
......
......@@ -134,13 +134,8 @@ int main(int argc, const char *argv[])
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
class_poseAs(objc_getClass("DumpRenderTreePasteboard"), objc_getClass("NSPasteboard"));
int width = 800;
int height = 600;
struct option options[] = {
{"width", required_argument, NULL, 'w'},
{"height", required_argument, NULL, 'h'},
{"pixel-tests", no_argument, &dumpPixels, YES},
{"tree", no_argument, &dumpTree, YES},
{"notree", no_argument, &dumpTree, NO},
......@@ -173,20 +168,6 @@ int main(int argc, const char *argv[])
int option;
while ((option = getopt_long(argc, (char * const *)argv, "", options, NULL)) != -1)
switch (option) {
case 'w':
width = strtol(optarg, NULL, 0);
if (width <= 0) {
fprintf(stderr, "%s: invalid width\n", argv[0]);
exit(1);
}
break;
case 'h':
height = strtol(optarg, NULL, 0);
if (height <= 0) {
fprintf(stderr, "%s: invalid height\n", argv[0]);
exit(1);
}
break;
case '?': // unknown or ambiguous option
case ':': // missing argument
exit(1);
......@@ -203,7 +184,7 @@ int main(int argc, const char *argv[])
localPasteboard = [NSPasteboard pasteboardWithUniqueName];
WebView *webView = [[WebView alloc] initWithFrame:NSMakeRect(0, 0, width, height)];
WebView *webView = [[WebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)];
WaitUntilDoneDelegate *delegate = [[WaitUntilDoneDelegate alloc] init];
EditingDelegate *editingDelegate = [[EditingDelegate alloc] init];
[webView setFrameLoadDelegate:delegate];
......@@ -264,8 +245,14 @@ static void dump(void)
DOMElement *documentElement = [[frame DOMDocument] documentElement];
if ([documentElement isKindOfClass:[DOMHTMLElement class]])
result = [[(DOMHTMLElement *)documentElement innerText] stringByAppendingString:@"\n"];
} else
} else {
bool isSVGW3CTest = ([currentTest rangeOfString:@"svg/W3C-SVG-1.1"].length);
if (isSVGW3CTest)
[[frame webView] setFrameSize:NSMakeSize(480, 360)];
else
[[frame webView] setFrameSize:NSMakeSize(800, 600)];
result = [frame renderTreeAsExternalRepresentation];
}
if (!result)
printf("ERROR: nil result from %s", dumpAsText ? "[documentElement innerText]" : "[frame renderTreeAsExternalRepresentation]");
......
......@@ -61,8 +61,6 @@ my $testSVGs = '';
my $pixelTests = '';
my $checkLeaks = '';
my $guardMalloc = '';
my $maxWidth = '';
my $maxHeight = '';
my $verbose = 0;
my $quiet = '';
my $singly = 0;
......@@ -72,8 +70,6 @@ GetOptions('svg' => \$testSVGs,
'pixel-tests|p' => \$pixelTests,
'leaks|l' => \$checkLeaks,
'guard-malloc|g' => \$guardMalloc,
'max-width|w=s' => \$maxWidth,
'max-height|h=s' => \$maxHeight,
'verbose|v' => \$verbose,
'quiet|q' => \$quiet,
'singly|1' => \$singly,
......@@ -84,9 +80,6 @@ my $result = system "WebKitTools/Scripts/build-dumprendertree", @ARGV;
exit $result if $result;
if ($testSVGs) {
$pixelTests = 1; # Pixel tests are always on for SVG.
# Temporary Hack: to pass w3c SVG layout tests which assume a smaller window size.
$maxWidth = 480 if (!$maxWidth);
$maxHeight = 360 if (!$maxHeight);
}
my $tool = "$productDir/$dumpToolName";
......@@ -113,6 +106,8 @@ my $prunePart = "\\( -name resources \\! -prune \\)";
my $extensionPart = "-name '*.html' -or -name '*.xml' -or -name '*.xhtml'";
if ($testSVGs) {
$extensionPart = "-name '*.svg' -or -name '*.xml'";
} elsif ($haveSVGSupport) {
$extensionPart .= " -or -name '*.svg'";
} else {
$prunePart .= " -or \\( -name svg \\! -prune \\)";
}
......@@ -153,8 +148,6 @@ my @toolArgs = ();
if ($pixelTests) {
push @toolArgs, "--pixel-tests";
push @toolArgs, ("--width", $maxWidth) if $maxWidth;
push @toolArgs, ("--height", $maxHeight) if $maxHeight;
}
push @toolArgs, "-";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment