summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/test
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/test')
-rw-r--r--rbutil/rbutilqt/test/test-httpget.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/test/test-httpget.cpp b/rbutil/rbutilqt/test/test-httpget.cpp
index c9ae86bc6c..a062203e70 100644
--- a/rbutil/rbutilqt/test/test-httpget.cpp
+++ b/rbutil/rbutilqt/test/test-httpget.cpp
@@ -118,6 +118,7 @@ class TestHttpGet : public QObject
118{ 118{
119 Q_OBJECT 119 Q_OBJECT
120 private slots: 120 private slots:
121 void testFileUrlRequest(void);
121 void testCachedRequest(void); 122 void testCachedRequest(void);
122 void testUncachedRepeatedRequest(void); 123 void testUncachedRepeatedRequest(void);
123 void testUncachedMovedRequest(void); 124 void testUncachedMovedRequest(void);
@@ -188,6 +189,27 @@ void TestHttpGet::cleanup(void)
188 if(m_doneSpy) delete m_doneSpy; 189 if(m_doneSpy) delete m_doneSpy;
189} 190}
190 191
192void TestHttpGet::testFileUrlRequest(void)
193{
194 QTimer::singleShot(TEST_HTTP_TIMEOUT, this, SLOT(waitTimeout(void)));
195
196 QString teststring = "The quick brown fox jumps over the lazy dog.";
197 QTemporaryFile datafile;
198 datafile.open();
199 datafile.write(teststring.toLatin1());
200 m_getter->getFile("file://" + datafile.fileName());
201 datafile.close();
202 while(m_doneSpy->count() == 0 && m_waitTimeoutOccured == false)
203 QCoreApplication::processEvents();
204
205 QCOMPARE(m_doneSpy->count(), 1);
206 QCOMPARE(m_waitTimeoutOccured, false);
207 QCOMPARE(m_daemon->lastRequestData().size(), 0);
208 QCOMPARE(m_getter->readAll(), teststring.toLatin1());
209 QCOMPARE(m_getter->httpResponse(), 200);
210}
211
212
191/* On uncached requests, HttpGet is supposed to sent a GET request only. 213/* On uncached requests, HttpGet is supposed to sent a GET request only.
192 */ 214 */
193void TestHttpGet::testUncachedRepeatedRequest(void) 215void TestHttpGet::testUncachedRepeatedRequest(void)