Changeset 85772 in webkit
- Timestamp:
- May 4, 2011 12:00:43 PM (13 years ago)
- Location:
- trunk/Source/WebKit/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/qt/ChangeLog
r85644 r85772 1 2011-05-04 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 Reviewed by Benjamin Poulain. 4 5 [Qt] Fix signals emitted in FakeReply used in autotests 6 https://bugs.webkit.org/show_bug.cgi?id=60049 7 8 The signals emitted for each case of FakeReply were swapped (error case 9 emitting metaDataChanged() and redirect case emitting error()). Emitting 10 readyRead() is not necessary. 11 12 * tests/qwebframe/tst_qwebframe.cpp: 13 (FakeReply::FakeReply): 14 Choose the different continue function for each case of FakeReply. This removes 15 the need of the if-statement in timeout() and let us replace timeout() with two 16 simpler functions. 17 18 (FakeReply::continueRedirect): 19 (FakeReply::continueError): 20 Continuation cases, emitting the minimal set of signals needed for each case. 21 1 22 2011-05-03 Julien Chaffraix <jchaffraix@codeaurora.org> 2 23 -
trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
r84189 r85772 2310 2310 setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html")); 2311 2311 setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html")); 2312 QTimer::singleShot(0, this, SLOT(continueRedirect())); 2312 2313 } 2313 2314 #ifndef QT_NO_OPENSSL 2314 else if (request.url() == QUrl("qrc:/fake-ssl-error.html")) 2315 setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error !")); // force a ssl error 2315 else if (request.url() == QUrl("qrc:/fake-ssl-error.html")) { 2316 setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error!")); 2317 QTimer::singleShot(0, this, SLOT(continueError())); 2318 } 2316 2319 #endif 2317 else if (request.url().host() == QLatin1String("abcdef.abcdef")) 2320 else if (request.url().host() == QLatin1String("abcdef.abcdef")) { 2318 2321 setError(QNetworkReply::HostNotFoundError, tr("Invalid URL")); 2322 QTimer::singleShot(0, this, SLOT(continueError())); 2323 } 2319 2324 2320 2325 open(QIODevice::ReadOnly); 2321 QTimer::singleShot(0, this, SLOT(timeout()));2322 2326 } 2323 2327 ~FakeReply() … … 2335 2339 2336 2340 private slots: 2337 void timeout() 2338 { 2339 if (request().url() == QUrl("qrc://test1.html")) 2340 emit error(this->error()); 2341 else if (request().url() == QUrl("http://abcdef.abcdef/")) 2342 emit metaDataChanged(); 2343 #ifndef QT_NO_OPENSSL 2344 else if (request().url() == QUrl("qrc:/fake-ssl-error.html")) 2345 return; 2346 #endif 2347 2348 emit readyRead(); 2341 void continueRedirect() 2342 { 2343 emit metaDataChanged(); 2344 emit finished(); 2345 } 2346 2347 void continueError() 2348 { 2349 emit error(this->error()); 2349 2350 emit finished(); 2350 2351 }
Note: See TracChangeset
for help on using the changeset viewer.