summaryrefslogtreecommitdiff
path: root/src/tests/protocolhandler_test.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-02-28 23:58:31 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-02-28 23:58:31 +0100
commitedea0f2fc34738de52a58f00c676e814f7a8c2fd (patch)
treed95082318d2e71d0a35847e92150b0d3762d094b /src/tests/protocolhandler_test.cpp
parentOk, we have 12 empty tests working... :) (diff)
downloadrekonq-edea0f2fc34738de52a58f00c676e814f7a8c2fd.tar.xz
First works on new Unit Tests..
Diffstat (limited to 'src/tests/protocolhandler_test.cpp')
-rw-r--r--src/tests/protocolhandler_test.cpp52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/tests/protocolhandler_test.cpp b/src/tests/protocolhandler_test.cpp
index d738baea..71d8d9ec 100644
--- a/src/tests/protocolhandler_test.cpp
+++ b/src/tests/protocolhandler_test.cpp
@@ -24,7 +24,7 @@
#include <QtCore>
#include <QtGui>
#include <QtTest>
-
+#include <QtWebKit>
#include "protocolhandler.h"
@@ -38,8 +38,12 @@ public slots:
void cleanupTestCase();
private slots:
+ void preHandling_data();
+ void preHandling();
-
+ void postHandling_data();
+ void postHandling();
+
private:
ProtocolHandler *handler;
};
@@ -62,6 +66,50 @@ void ProtocolhandlerTest::cleanupTestCase()
// -------------------------------------------
+void ProtocolhandlerTest::preHandling_data()
+{
+ QTest::addColumn<QString>("urlString");
+
+ QTest::newRow("mailto") << "mailto:me@here.com";
+ QTest::newRow("relative") << "google.it";
+ QTest::newRow("javascript") << "javascript:alertbox('hello')";
+ QTest::newRow("aboutblank") << "about:blank";
+ QTest::newRow("abouthome") << "about:home";
+ QTest::newRow("ftp") << "ftp://ftp.kde.org";
+ QTest::newRow("file") << "file:///home";
+}
+
+
+void ProtocolhandlerTest::preHandling()
+{
+// QFETCH( QString, urlString );
+//
+// QWebView *view = new QWebView;
+// QWebFrame *frame = view->page()->mainFrame();
+//
+// QNetworkRequest *request = new QNetworkRequest( QUrl(urlString) );
+// handler->preHandling( request, frame );
+}
+
+
+void ProtocolhandlerTest::postHandling_data()
+{
+ QTest::addColumn<QString>("urlString");
+
+ QTest::newRow("mailto") << "mailto:me@here.com";
+ QTest::newRow("relative") << "google.it";
+ QTest::newRow("javascript") << "javascript:alertbox('hello')";
+ QTest::newRow("aboutblank") << "about:blank";
+ QTest::newRow("abouthome") << "about:home";
+ QTest::newRow("ftp") << "ftp://ftp.kde.org";
+ QTest::newRow("file") << "file:///home";
+}
+
+
+void ProtocolhandlerTest::postHandling()
+{
+}
+
// -------------------------------------------
QTEST_KDEMAIN(ProtocolhandlerTest,GUI)