+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
* 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
#include "config.h"
#include "DumpRenderTree.h"
+#include "DumpRenderTreeClient.h"
#include "Page.h"
#include "markup.h"
#include "ChromeClientQt.h"
#include "ContextMenuClientQt.h"
#include "EditorClientQt.h"
+#include "FrameLoaderClientQt.h"
#include <QDir>
#include <QFile>
{
// 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);
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)));
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;
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()));
}
}
-#include "DumpRenderTree.moc"
* 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
#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);
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
}