Commit 2c0cce38 authored by lars's avatar lars

Reviewed by Zack

        Get DumpRenderTree to work again for the Qt build.

        Make run-webkit-tests a little less verbose when testing
        Qt, and add an option to run DumpRenderTree inside valgrind
        (useful for debugging)



git-svn-id: svn://svn.chromium.org/blink/trunk@18804 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 86f5ebbd
2007-01-12 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
Get DumpRenderTree to work again for the Qt build.
Make run-webkit-tests a little less verbose when testing
Qt, and add an option to run DumpRenderTree inside valgrind
(useful for debugging)
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
(WebCore::DumpRenderTree::DumpRenderTree):
(WebCore::DumpRenderTree::~DumpRenderTree):
(WebCore::DumpRenderTree::open):
(WebCore::DumpRenderTree::dump):
(WebCore::DumpRenderTree::maybeDump):
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h:
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp:
(WebCore::DumpRenderTreeClient::dispatchDidHandleOnloadEvents):
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h:
* DumpRenderTree/DumpRenderTree.qtproj/tests-skipped.txt:
* Scripts/run-webkit-tests:
2007-01-12 Zack Rusin <zack@kde.org>
Add WEBKIT_FULLBUILD env variable to get the
......
......@@ -87,7 +87,9 @@ DumpRenderTree::DumpRenderTree()
view->setParentWidget(0 /* no toplevel widget */);
m_controller = new LayoutTestController();
QObject::connect(m_controller, SIGNAL(done()), this, SLOT(dump()));
QObject::connect(m_controller, SIGNAL(done()), this, SLOT(dump()), Qt::QueuedConnection);
QObject::connect(this, SIGNAL(quit()), qApp, SLOT(quit()), Qt::QueuedConnection);
// Reverse calculations in QAbstractScrollArea::maximumViewportSize()
QScrollArea* area = qobject_cast<QScrollArea*>(m_frame->view()->qwidget());
......@@ -104,7 +106,6 @@ DumpRenderTree::DumpRenderTree()
DumpRenderTree::~DumpRenderTree()
{
delete m_frame;
delete m_client;
delete m_stdin;
delete m_notifier;
......@@ -136,9 +137,6 @@ void DumpRenderTree::open(const KURL& url)
}
m_frame->client()->openURL(url);
// Simple poll mechanism, to find out when the page is loaded...
checkLoaded();
}
void DumpRenderTree::readStdin(int /* socket */)
......@@ -207,37 +205,39 @@ void DumpRenderTree::initJSObjects()
void DumpRenderTree::dump()
{
if (!m_notifier) {
// Dump markup in single file mode...
DeprecatedString markup = createMarkup(m_frame->document());
fprintf(stdout, "Source:\n\n%s\n", markup.ascii());
}
// Dump render text...
String renderDump;
if (m_controller->shouldDumpAsText()) {
Element *documentElement = m_frame->document()->documentElement();
renderDump = documentElement->innerText();
renderDump.append("\n");
} else {
renderDump = externalRepresentation(m_frame->renderer());
}
//qDebug() << ">>>>>>>>>>>>>>>>>>>>>> Dumping" << m_frame->loader()->URL().url();
if (!m_notifier) {
// Dump markup in single file mode...
DeprecatedString markup = createMarkup(m_frame->document());
fprintf(stdout, "Source:\n\n%s\n", markup.ascii());
}
// Dump render text...
String renderDump;
if (m_controller->shouldDumpAsText()) {
Element *documentElement = m_frame->document()->documentElement();
renderDump = documentElement->innerText();
renderDump.append("\n");
} else {
renderDump = externalRepresentation(m_frame->renderer());
}
if (renderDump.isEmpty()) {
printf("ERROR: nil result from %s", m_controller->shouldDumpAsText() ? "[documentElement innerText]" : "[frame renderTreeAsExternalRepresentation]");
} else {
fprintf(stdout, "%s#EOF\n", renderDump.utf8().data());
fflush(stdout);
if (!m_notifier) {
// Exit now in single file mode...
QApplication::exit();
}
}
fflush(stdout);
if (!m_notifier) {
// Exit now in single file mode...
quit();
}
}
void DumpRenderTree::checkLoaded()
void DumpRenderTree::maybeDump()
{
if (m_frame->loader()->isComplete() && !m_controller->shouldWaitUntilDone()) {
if (!m_controller->shouldWaitUntilDone())
dump();
return;
}
QTimer::singleShot(10, this, SLOT(checkLoaded()));
}
FrameQt* DumpRenderTree::frame() const
......
......@@ -58,9 +58,11 @@ public:
public Q_SLOTS:
void readStdin(int);
void checkLoaded();
void maybeDump();
void dump();
Q_SIGNALS:
void quit();
private:
friend class DumpRenderTreeClient;
......
......@@ -48,6 +48,11 @@ void DumpRenderTreeClient::partClearedInBegin()
dumper->initJSObjects();
}
void DumpRenderTreeClient::dispatchDidHandleOnloadEvents()
{
dumper->maybeDump();
}
}
// vim: ts=4 sw=4 et
......@@ -40,6 +40,7 @@ public:
virtual ~DumpRenderTreeClient();
virtual void partClearedInBegin();
void dispatchDidHandleOnloadEvents();
private:
DumpRenderTree *dumper;
......
......@@ -2,6 +2,7 @@
fast/dom/location-hash.html
fast/forms/access-key.html
fast/overflow/scroll-vertical-not-horizontal.html
dom/xhtml/level2/html/HTMLDocument17.xhtml
# As kcanvas is in the process of being killed,
# we didn't even start implementing filtrs / masks
......
......@@ -92,6 +92,7 @@ my $testOnlySVGs = '';
my $testResultsDirectory = "/tmp/layout-test-results";
my $threaded = 0;
my $verbose = 0;
my $use_valgrind = 0;
my $expectedTag = "expected";
if (isCygwin()) {
......@@ -137,7 +138,8 @@ my $usage =
" --svg Run only SVG tests (implies --pixel-tests)\n" .
" -t|--threaded Run a concurrent JavaScript thead with each test\n" .
" -v|--verbose More verbose output (overrides --quiet)\n" .
" --debug|--release Set DumpRenderTree build configuration\n";
" --debug|--release Set DumpRenderTree build configuration\n" .
" --valgrind Run DumpRenderTree inside valgrind (Linux only)\n";
# Parse out build options (--debug or --release) first
my $buildConfiguration = setConfiguration();
......@@ -161,6 +163,7 @@ my $getOptionsResult = GetOptions(
'svg' => \$testOnlySVGs,
'threaded|t' => \$threaded,
'verbose|v' => \$verbose,
'valgrind' => \$use_valgrind,
);
if (!$getOptionsResult || $showHelp) {
......@@ -481,14 +484,14 @@ for my $test (@tests) {
system "diff -u \"/tmp/expected.txt\" \"/tmp/actual.txt\" > \"/tmp/simplified.diff\"";
$diffResult = "failed";
print "\n";
system "cat /tmp/simplified.diff";
if($verbose) {
print "\n";
system "cat /tmp/simplified.diff";
print "failed!!!!!";
}
}
}
}
}
if (!defined $expected) {
if ($verbose) {
......@@ -899,7 +902,15 @@ sub openDumpRenderTreeIfNeeded()
$ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995>
$ENV{MallocStackLogging} = 1 if $checkLeaks;
$ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
$dumpToolPID = open2(\*IN, \*OUT, $tool, @toolArgs) or die "Failed to start tool: $tool\n";
my @args = ();
if ($use_valgrind) {
push @args, $tool;
}
push @args, @toolArgs;
if ($use_valgrind) {
$tool = "valgrind";
}
$dumpToolPID = open2(\*IN, \*OUT, $tool, @args) or die "Failed to start tool: $tool\n";
$toolOpen = 1;
}
......
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