Commit c9055508 authored by zack's avatar zack

Include DumpRenderTree in the Qt build and adjust it to the

recet platform/qt changes (by lars)


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@18128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 75bf7ef8
2006-12-10 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
Include DumpRenderTree in the Qt build
* WebKit.pro:
2006-12-09 George Staikos <staikos@kde.org>
Reviewed by Zack.
......
......@@ -3,5 +3,5 @@ CONFIG += ordered
SUBDIRS = \
JavaScriptCore \
WebCore \
WebKitQt/QtLauncher
WebKitQt/QtLauncher \
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.pro
2006-12-10 Lars Knoll <lars@trolltech.com>
Reviewed by Zack
Get the DumpRenderTree app to compile again
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
(WebCore::DumpRenderTree::DumpRenderTree):
(WebCore::DumpRenderTree::open):
(WebCore::DumpRenderTree::readStdin):
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.pro: Added.
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.cpp:
(WebCore::DumpRenderTreeClient::DumpRenderTreeClient):
* DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTreeClient.h:
* DumpRenderTree/DumpRenderTree.qtproj/main.cpp:
(main):
2006-12-09 George Staikos <staikos@kde.org>
Reviewed by Zack.
......
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
*
* Redistribution and use in source and binary forms, with or without
......@@ -7,13 +7,13 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
......@@ -29,6 +29,7 @@
#include "config.h"
#include "DumpRenderTree.h"
#include "DumpRenderTreeClient.h"
#include "Page.h"
#include "markup.h"
......@@ -40,6 +41,7 @@
#include "ChromeClientQt.h"
#include "ContextMenuClientQt.h"
#include "EditorClientQt.h"
#include "FrameLoaderClientQt.h"
#include <QDir>
#include <QFile>
......@@ -64,7 +66,7 @@ DumpRenderTree::DumpRenderTree()
{
// Initialize WebCore in Qt platform mode...
Page* page = new Page(new ChromeClientQt(), new ContextMenuClientQt(), new EditorClientQt());
m_frame = new FrameQt(page, 0, m_client);
m_frame = new FrameQt(page, 0, m_client, new FrameLoaderClientQt());
FrameView* view = new FrameView(m_frame);
view->setScrollbarsMode(ScrollbarAlwaysOff);
......@@ -96,8 +98,8 @@ DumpRenderTree::~DumpRenderTree()
void DumpRenderTree::open()
{
if (!m_stdin)
m_stdin = new QTextStream(stdin, IO_ReadOnly);
m_stdin = new QTextStream(stdin, QFile::ReadOnly);
if (!m_notifier) {
m_notifier = new QSocketNotifier(STDIN_FILENO, QSocketNotifier::Read);
connect(m_notifier, SIGNAL(activated(int)), this, SLOT(readStdin(int)));
......@@ -109,7 +111,7 @@ void DumpRenderTree::open(const KURL& url)
Q_ASSERT(url.isLocalFile());
// Ignore skipped tests
if (m_skipped.indexOf(url.path()) != -1) {
if (m_skipped.indexOf(url.path()) != -1) {
fprintf(stdout, "#EOF\n");
fflush(stdout);
return;
......@@ -124,8 +126,8 @@ void DumpRenderTree::open(const KURL& url)
void DumpRenderTree::readStdin(int /* socket */)
{
// Read incoming data from stdin...
QString line = m_stdin->readLine();
if (!line.isEmpty())
QString line = m_stdin->readLine();
if (!line.isEmpty())
open(KURL(line.toLatin1()));
}
......@@ -188,4 +190,3 @@ FrameQt* DumpRenderTree::frame() const
}
#include "DumpRenderTree.moc"
......@@ -35,7 +35,7 @@
namespace WebCore {
DumpRenderTreeClient::DumpRenderTreeClient()
: FrameQtClientDefault()
: FrameQtClient()
{
}
......
......@@ -32,7 +32,7 @@
namespace WebCore {
class DumpRenderTreeClient : public FrameQtClientDefault
class DumpRenderTreeClient : public FrameQtClient
{
public:
DumpRenderTreeClient();
......
......@@ -6,13 +6,13 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
......@@ -30,19 +30,25 @@
#include "DumpRenderTree.h"
#include "KURL.h"
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <qstringlist.h>
using namespace WebCore;
#if PLATFORM(KDE)
#include <kapplication.h>
#include <kcmdlineargs.h>
static KCmdLineOptions options[] =
{
{ "+file", "File to load", 0 },
KCmdLineLastOption
};
#else
#include <qapplication.h>
#endif
int main(int argc, char* argv[])
{
#if PLATFORM(KDE)
KCmdLineArgs::init(argc, argv, "DumpRenderTree", "DumpRenderTree", "testing application", "0.1");
KCmdLineArgs::addCmdLineOptions(options);
......@@ -57,4 +63,19 @@ int main(int argc, char* argv[])
dumper.open(KURL(args->arg(0)));
return app.exec();
#else
QApplication app(argc, argv);
const QStringList args = app.arguments();
WebCore::DumpRenderTree dumper;
if (args.count() == 2 && args[1] == QLatin1String("-"))
dumper.open();
else if (args.count() == 2)
dumper.open(KURL(args[1]));
return app.exec();
#endif
}
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