Commit 9a975856 authored by kenneth@webkit.org's avatar kenneth@webkit.org

2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>

        Reviewed by Adam Treat.

        Fix indentation.

        * tests/qwebframe/tst_qwebframe.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4b4c0fcb
2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Adam Treat.
Fix indentation.
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com>
Reviewed by Simon Hausmann.
......
......@@ -2167,43 +2167,45 @@ void tst_QWebFrame::domCycles()
class FakeReply : public QNetworkReply {
Q_OBJECT
public:
FakeReply(const QNetworkRequest& request, QObject* parent = 0)
: QNetworkReply(parent)
{
setOperation(QNetworkAccessManager::GetOperation);
setRequest(request);
if (request.url() == QUrl("qrc:/test1.html")) {
setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
} else
setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
open(QIODevice::ReadOnly);
QTimer::singleShot(0, this, SLOT(timeout()));
}
~FakeReply()
{
close();
}
virtual void abort() {}
virtual void close() {}
protected:
qint64 readData(char*, qint64)
{
return 0;
}
private slots:
void timeout()
{
if (request().url() == QUrl("qrc://test1.html"))
emit error(this->error());
else if (request().url() == QUrl("http://abcdef.abcdef/"))
emit metaDataChanged();
public:
FakeReply(const QNetworkRequest& request, QObject* parent = 0)
: QNetworkReply(parent)
{
setOperation(QNetworkAccessManager::GetOperation);
setRequest(request);
if (request.url() == QUrl("qrc:/test1.html")) {
setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
} else
setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
emit readyRead();
emit finished();
}
open(QIODevice::ReadOnly);
QTimer::singleShot(0, this, SLOT(timeout()));
}
~FakeReply()
{
close();
}
virtual void abort() {}
virtual void close() {}
protected:
qint64 readData(char*, qint64)
{
return 0;
}
private slots:
void timeout()
{
if (request().url() == QUrl("qrc://test1.html"))
emit error(this->error());
else if (request().url() == QUrl("http://abcdef.abcdef/"))
emit metaDataChanged();
emit readyRead();
emit finished();
}
};
class FakeNetworkManager : public QNetworkAccessManager {
......
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