summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-02-28 12:22:25 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-02-28 12:22:25 +0100
commitd897ce42be8375ffab89615ab3953b8bd3ab3bbc (patch)
tree5998e3d2df0e524ae31c60c0146c046b818e07d5 /src/tests
parentNew (embrional) unit tests: mainview, tabbar, webtab, webpage (diff)
downloadrekonq-d897ce42be8375ffab89615ab3953b8bd3ab3bbc.tar.xz
All the other (blank) tests..
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/CMakeLists.txt97
-rw-r--r--src/tests/findbar_test.cpp64
-rw-r--r--src/tests/mainview_test.cpp8
-rw-r--r--src/tests/mainwindow_test.cpp62
-rw-r--r--src/tests/networkaccessmanager_test.cpp65
-rw-r--r--src/tests/protocolhandler_test.cpp65
-rw-r--r--src/tests/sessionmanager_test.cpp66
-rw-r--r--src/tests/walletbar_test.cpp66
-rw-r--r--src/tests/webpage_test.cpp8
-rw-r--r--src/tests/websnap_test.cpp67
-rw-r--r--src/tests/webtab_test.cpp4
-rw-r--r--src/tests/webview_test.cpp65
12 files changed, 624 insertions, 13 deletions
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index ccb25551..cdeea5ee 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -14,11 +14,22 @@ INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_BINARY_DIR}
${QT4_INCLUDES}
)
-##### ------------- tabbar test
+##### ------------- findbar test
-kde4_add_unit_test( tabbar_test tabbar_test.cpp )
+kde4_add_unit_test( findbar_test findbar_test.cpp )
-target_link_libraries( tabbar_test
+target_link_libraries( findbar_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
+##### ------------- mainwindow test
+
+kde4_add_unit_test( mainwindow_test mainwindow_test.cpp )
+
+target_link_libraries( mainwindow_test
kdeinit_rekonq
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
@@ -36,6 +47,62 @@ target_link_libraries( mainview_test
${QT_QTTEST_LIBRARY}
)
+##### ------------- networkaccessmanager test
+
+kde4_add_unit_test( networkaccessmanager_test networkaccessmanager_test.cpp )
+
+target_link_libraries( networkaccessmanager_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
+##### ------------- protocolhandler test
+
+kde4_add_unit_test( protocolhandler_test protocolhandler_test.cpp )
+
+target_link_libraries( protocolhandler_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
+##### ------------- sessionmanager test
+
+kde4_add_unit_test( sessionmanager_test sessionmanager_test.cpp )
+
+target_link_libraries( sessionmanager_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
+##### ------------- tabbar test
+
+kde4_add_unit_test( tabbar_test tabbar_test.cpp )
+
+target_link_libraries( tabbar_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
+##### ------------- walletbar test
+
+kde4_add_unit_test( walletbar_test walletbar_test.cpp )
+
+target_link_libraries( walletbar_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${KDE4_KDEWEBKIT_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
##### ------------- webpage test
kde4_add_unit_test( webpage_test webpage_test.cpp )
@@ -48,6 +115,18 @@ target_link_libraries( webpage_test
${QT_QTTEST_LIBRARY}
)
+##### ------------- websnap test
+
+kde4_add_unit_test( websnap_test websnap_test.cpp )
+
+target_link_libraries( websnap_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${KDE4_KDEWEBKIT_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
##### ------------- webtab test
kde4_add_unit_test( webtab_test webtab_test.cpp )
@@ -60,4 +139,16 @@ target_link_libraries( webtab_test
${QT_QTTEST_LIBRARY}
)
+##### ------------- webview test
+
+kde4_add_unit_test( webview_test webview_test.cpp )
+
+target_link_libraries( webview_test
+ kdeinit_rekonq
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${KDE4_KDEWEBKIT_LIBS}
+ ${QT_QTTEST_LIBRARY}
+)
+
############################################################
diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp
new file mode 100644
index 00000000..0e332b6a
--- /dev/null
+++ b/src/tests/findbar_test.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "findbar.h"
+
+
+
+class FindBarTest : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+
+private:
+ FindBar *bar;
+};
+
+
+// -------------------------------------------
+
+
+void FindBarTest::initTestCase()
+{
+}
+
+
+void FindBarTest::cleanupTestCase()
+{
+}
+
+
+// -------------------------------------------
+
+QTEST_MAIN(FindBarTest)
+#include "findbar_test.moc"
diff --git a/src/tests/mainview_test.cpp b/src/tests/mainview_test.cpp
index 1dfffcbe..41ded862 100644
--- a/src/tests/mainview_test.cpp
+++ b/src/tests/mainview_test.cpp
@@ -100,16 +100,16 @@ private:
// It is only called once.
void MainViewTest::initTestCase()
{
- mainWindow = new MainWindow;
- mainView = new SubMainView(mainWindow);
+// mainWindow = new MainWindow;
+// mainView = new SubMainView(mainWindow);
}
// This will be called after the last test function is executed.
// It is only called once.
void MainViewTest::cleanupTestCase()
{
- delete mainView;
- delete mainWindow;
+// delete mainView;
+// delete mainWindow;
}
// -------------------------------------------
diff --git a/src/tests/mainwindow_test.cpp b/src/tests/mainwindow_test.cpp
new file mode 100644
index 00000000..f5342dfa
--- /dev/null
+++ b/src/tests/mainwindow_test.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "mainwindow.h"
+
+
+class MainWindowTest : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+
+private:
+ MainWindow *window;
+};
+
+
+// -------------------------------------------
+
+
+void MainWindowTest::initTestCase()
+{
+}
+
+
+void MainWindowTest::cleanupTestCase()
+{
+}
+
+// -------------------------------------------
+
+QTEST_MAIN(MainWindowTest)
+#include "mainwindow_test.moc"
diff --git a/src/tests/networkaccessmanager_test.cpp b/src/tests/networkaccessmanager_test.cpp
new file mode 100644
index 00000000..41c9fb56
--- /dev/null
+++ b/src/tests/networkaccessmanager_test.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "networkaccessmanager.h"
+
+
+class NetworkAccessManagerTest : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+private:
+ NetworkAccessManager *manager;
+};
+
+
+// -------------------------------------------
+
+void NetworkAccessManagerTest::initTestCase()
+{
+}
+
+
+void NetworkAccessManagerTest::cleanupTestCase()
+{
+}
+
+
+// -------------------------------------------
+
+
+
+// -------------------------------------------
+
+QTEST_MAIN(NetworkAccessManagerTest)
+#include "networkaccessmanager_test.moc"
diff --git a/src/tests/protocolhandler_test.cpp b/src/tests/protocolhandler_test.cpp
new file mode 100644
index 00000000..13e4212c
--- /dev/null
+++ b/src/tests/protocolhandler_test.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "protocolhandler.h"
+
+
+class ProtocolhandlerTest : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+
+private:
+ ProtocolHandler *handler;
+};
+
+
+// -------------------------------------------
+
+void ProtocolhandlerTest::initTestCase()
+{
+}
+
+
+void ProtocolhandlerTest::cleanupTestCase()
+{
+}
+
+
+// -------------------------------------------
+
+
+// -------------------------------------------
+
+QTEST_MAIN(ProtocolhandlerTest)
+#include "protocolhandler_test.moc"
diff --git a/src/tests/sessionmanager_test.cpp b/src/tests/sessionmanager_test.cpp
new file mode 100644
index 00000000..6cbd1bef
--- /dev/null
+++ b/src/tests/sessionmanager_test.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "sessionmanager.h"
+
+
+class SessionManagerTest : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+private:
+ SessionManager *sessman;
+};
+
+
+// -------------------------------------------
+
+
+void SessionManagerTest::initTestCase()
+{
+}
+
+
+void SessionManagerTest::cleanupTestCase()
+{
+}
+
+
+// -------------------------------------------
+
+
+
+// -------------------------------------------
+
+QTEST_MAIN(SessionManagerTest)
+#include "sessionmanager_test.moc"
diff --git a/src/tests/walletbar_test.cpp b/src/tests/walletbar_test.cpp
new file mode 100644
index 00000000..a3b87710
--- /dev/null
+++ b/src/tests/walletbar_test.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "walletbar.h"
+
+
+class WalletBarTest : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+private:
+ WalletBar *bar;
+};
+
+
+// -------------------------------------------
+
+
+void WalletBarTest::initTestCase()
+{
+}
+
+
+void WalletBarTest::cleanupTestCase()
+{
+}
+
+
+// -------------------------------------------
+
+
+
+// -------------------------------------------
+
+QTEST_MAIN(WalletBarTest)
+#include "walletbar_test.moc"
diff --git a/src/tests/webpage_test.cpp b/src/tests/webpage_test.cpp
index 7afb5502..5d563160 100644
--- a/src/tests/webpage_test.cpp
+++ b/src/tests/webpage_test.cpp
@@ -74,15 +74,15 @@ WebPageTest::~WebPageTest()
void WebPageTest::initTestCase()
{
- tab = new WebTab;
- view = new WebView(tab);
- page = view->page();
+// tab = new WebTab;
+// view = new WebView(tab);
+// page = view->page();
}
void WebPageTest::cleanupTestCase()
{
- delete tab;
+// delete tab;
}
diff --git a/src/tests/websnap_test.cpp b/src/tests/websnap_test.cpp
new file mode 100644
index 00000000..9c648370
--- /dev/null
+++ b/src/tests/websnap_test.cpp
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "websnap.h"
+
+
+class WebSnapTest : public QObject
+{
+ Q_OBJECT
+
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+private:
+ WebSnap *snap;
+};
+
+
+// -------------------------------------------
+
+
+void WebSnapTest::initTestCase()
+{
+}
+
+
+void WebSnapTest::cleanupTestCase()
+{
+}
+
+
+// -------------------------------------------
+
+
+
+// -------------------------------------------
+
+QTEST_MAIN(WebSnapTest)
+#include "websnap_test.moc"
diff --git a/src/tests/webtab_test.cpp b/src/tests/webtab_test.cpp
index ae5647f3..42d5388b 100644
--- a/src/tests/webtab_test.cpp
+++ b/src/tests/webtab_test.cpp
@@ -48,13 +48,13 @@ private:
void WebTabTest::initTestCase()
{
- tab = new WebTab;
+// tab = new WebTab;
}
void WebTabTest::cleanupTestCase()
{
- delete tab;
+// delete tab;
}
diff --git a/src/tests/webview_test.cpp b/src/tests/webview_test.cpp
new file mode 100644
index 00000000..82334a30
--- /dev/null
+++ b/src/tests/webview_test.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2010 Andrea Diamantini <adjam7@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <qtest_kde.h>
+
+#include <QtTest>
+#include <QtCore>
+#include <QtWebKit>
+
+#include "webview.h"
+
+
+class WebViewTest : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+private slots:
+
+private:
+ WebView *view;
+};
+
+
+// -------------------------------------------
+
+
+void WebViewTest::initTestCase()
+{
+}
+
+
+void WebViewTest::cleanupTestCase()
+{
+}
+
+
+// -------------------------------------------
+
+
+// -------------------------------------------
+
+QTEST_MAIN(WebViewTest)
+#include "webview_test.moc"