diff options
| author | Andrea Diamantini <adjam7@gmail.com> | 2010-02-28 17:05:37 +0100 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2010-02-28 17:05:37 +0100 | 
| commit | e5e4ffa0e844c4f1cbe40eeaa309c4711c1073e6 (patch) | |
| tree | ddfa948cc8a66e60726afd0b226ceb1a98af68f3 /src | |
| parent | Changing Findbar parent (diff) | |
| download | rekonq-e5e4ffa0e844c4f1cbe40eeaa309c4711c1073e6.tar.xz | |
10 (of 12) tests working and ready to be "expanded"..
Diffstat (limited to 'src')
| -rw-r--r-- | src/tests/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/tests/findbar_test.cpp | 10 | ||||
| -rw-r--r-- | src/tests/mainview_test.cpp | 26 | ||||
| -rw-r--r-- | src/tests/mainwindow_test.cpp | 9 | ||||
| -rw-r--r-- | src/tests/networkaccessmanager_test.cpp | 8 | ||||
| -rw-r--r-- | src/tests/protocolhandler_test.cpp | 9 | ||||
| -rw-r--r-- | src/tests/sessionmanager_test.cpp | 9 | ||||
| -rw-r--r-- | src/tests/walletbar_test.cpp | 9 | ||||
| -rw-r--r-- | src/tests/webpage_test.cpp | 13 | ||||
| -rw-r--r-- | src/tests/websnap_test.cpp | 7 | ||||
| -rw-r--r-- | src/tests/webtab_test.cpp | 9 | ||||
| -rw-r--r-- | src/tests/webview_test.cpp | 10 | 
12 files changed, 65 insertions, 55 deletions
| diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index cdeea5ee..0230a5ce 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -22,6 +22,7 @@ target_link_libraries( findbar_test      kdeinit_rekonq      ${KDE4_KDECORE_LIBS}      ${KDE4_KDEUI_LIBS} +    ${QT_QTGUI_LIBRARY}      ${QT_QTTEST_LIBRARY}  ) diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp index 3fb0e244..6b81255f 100644 --- a/src/tests/findbar_test.cpp +++ b/src/tests/findbar_test.cpp @@ -21,9 +21,8 @@  #include <qtest_kde.h> -#include <QtTest> -#include <QtCore> -#include <QtWebKit> +#include <QtGui> +#include <QtTest/QtTest>  #include "findbar.h"  #include "mainwindow.h" @@ -43,6 +42,7 @@ private slots:  private:      FindBar *bar; +    MainWindow *w;  }; @@ -51,7 +51,7 @@ private:  void FindBarTest::initTestCase()  { -    MainWindow *w = new MainWindow; +    w = new MainWindow;      bar = new FindBar(w);  } @@ -71,5 +71,5 @@ void FindBarTest::notifyMatch()  // ------------------------------------------- -QTEST_MAIN(FindBarTest) +QTEST_KDEMAIN(FindBarTest, GUI)  #include "findbar_test.moc" diff --git a/src/tests/mainview_test.cpp b/src/tests/mainview_test.cpp index 41ded862..30d4e7dd 100644 --- a/src/tests/mainview_test.cpp +++ b/src/tests/mainview_test.cpp @@ -27,27 +27,14 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore>  #include <QtGui> +#include <QtTest>  #include "mainview.h"  #include "webview.h" -// Subclass that exposes the protected functions. -class SubMainView : public MainView -{ -public: -    SubMainView(MainWindow *parent) : MainView(parent) {}; -     -    void call_resizeEvent(QResizeEvent *event) -        { return SubMainView::resizeEvent(event); } -}; - -// ----------------------------------------------------------- - -  class MainViewTest : public QObject  {      Q_OBJECT @@ -88,8 +75,8 @@ private slots:      void currentChanged();  private: -    MainWindow *mainWindow; -    SubMainView *mainView; +    MainWindow *window; +    MainView *view;  }; @@ -100,16 +87,15 @@ private:  // It is only called once.  void MainViewTest::initTestCase()  { -//     mainWindow = new MainWindow; -//     mainView = new SubMainView(mainWindow); +    window = new MainWindow; +    view = window->mainView();  }  // This will be called after the last test function is executed.  // It is only called once.  void MainViewTest::cleanupTestCase()  { -//     delete mainView; -//     delete mainWindow; +    delete window;  }  // ------------------------------------------- diff --git a/src/tests/mainwindow_test.cpp b/src/tests/mainwindow_test.cpp index f5342dfa..90ae26bd 100644 --- a/src/tests/mainwindow_test.cpp +++ b/src/tests/mainwindow_test.cpp @@ -21,11 +21,12 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> -#include <QtWebKit> +#include <QtGui> +#include <QtTest>  #include "mainwindow.h" +#include "application.h"  class MainWindowTest : public QObject @@ -49,14 +50,16 @@ private:  void MainWindowTest::initTestCase()  { +    window = new MainWindow;  }  void MainWindowTest::cleanupTestCase()  { +    delete window;  }  // ------------------------------------------- -QTEST_MAIN(MainWindowTest) +QTEST_KDEMAIN(MainWindowTest,GUI)  #include "mainwindow_test.moc" diff --git a/src/tests/networkaccessmanager_test.cpp b/src/tests/networkaccessmanager_test.cpp index 41c9fb56..68ffc108 100644 --- a/src/tests/networkaccessmanager_test.cpp +++ b/src/tests/networkaccessmanager_test.cpp @@ -21,9 +21,9 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> -#include <QtWebKit> +#include <QtGui> +#include <QtTest>  #include "networkaccessmanager.h" @@ -47,11 +47,13 @@ private:  void NetworkAccessManagerTest::initTestCase()  { +    manager = new NetworkAccessManager;  }  void NetworkAccessManagerTest::cleanupTestCase()  { +    delete manager;  } @@ -61,5 +63,5 @@ void NetworkAccessManagerTest::cleanupTestCase()  // ------------------------------------------- -QTEST_MAIN(NetworkAccessManagerTest) +QTEST_KDEMAIN(NetworkAccessManagerTest,GUI)  #include "networkaccessmanager_test.moc" diff --git a/src/tests/protocolhandler_test.cpp b/src/tests/protocolhandler_test.cpp index 13e4212c..d738baea 100644 --- a/src/tests/protocolhandler_test.cpp +++ b/src/tests/protocolhandler_test.cpp @@ -21,9 +21,10 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> -#include <QtWebKit> +#include <QtGui> +#include <QtTest> +  #include "protocolhandler.h" @@ -48,11 +49,13 @@ private:  void ProtocolhandlerTest::initTestCase()  { +    handler = new ProtocolHandler;  }  void ProtocolhandlerTest::cleanupTestCase()  { +    delete handler;  } @@ -61,5 +64,5 @@ void ProtocolhandlerTest::cleanupTestCase()  // ------------------------------------------- -QTEST_MAIN(ProtocolhandlerTest) +QTEST_KDEMAIN(ProtocolhandlerTest,GUI)  #include "protocolhandler_test.moc" diff --git a/src/tests/sessionmanager_test.cpp b/src/tests/sessionmanager_test.cpp index 6cbd1bef..e3e1b329 100644 --- a/src/tests/sessionmanager_test.cpp +++ b/src/tests/sessionmanager_test.cpp @@ -21,9 +21,10 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> -#include <QtWebKit> +#include <QtGui> +#include <QtTest> +  #include "sessionmanager.h" @@ -48,11 +49,13 @@ private:  void SessionManagerTest::initTestCase()  { +    sessman = new SessionManager;  }  void SessionManagerTest::cleanupTestCase()  { +    delete sessman;  } @@ -62,5 +65,5 @@ void SessionManagerTest::cleanupTestCase()  // ------------------------------------------- -QTEST_MAIN(SessionManagerTest) +QTEST_KDEMAIN(SessionManagerTest,GUI)  #include "sessionmanager_test.moc" diff --git a/src/tests/walletbar_test.cpp b/src/tests/walletbar_test.cpp index a3b87710..ec9c3559 100644 --- a/src/tests/walletbar_test.cpp +++ b/src/tests/walletbar_test.cpp @@ -21,9 +21,9 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> -#include <QtWebKit> +#include <QtGui> +#include <QtTest>  #include "walletbar.h" @@ -48,11 +48,14 @@ private:  void WalletBarTest::initTestCase()  { +    QWidget *w = new QWidget; +    bar = new WalletBar(w);  }  void WalletBarTest::cleanupTestCase()  { +    delete bar;  } @@ -62,5 +65,5 @@ void WalletBarTest::cleanupTestCase()  // ------------------------------------------- -QTEST_MAIN(WalletBarTest) +QTEST_KDEMAIN(WalletBarTest,GUI)  #include "walletbar_test.moc" diff --git a/src/tests/webpage_test.cpp b/src/tests/webpage_test.cpp index 5d563160..3527f1ed 100644 --- a/src/tests/webpage_test.cpp +++ b/src/tests/webpage_test.cpp @@ -21,8 +21,9 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> +#include <QtGui> +#include <QtTest>  #include <QtWebKit>  #include "webpage.h" @@ -74,15 +75,15 @@ WebPageTest::~WebPageTest()  void WebPageTest::initTestCase()  { -//     tab = new WebTab; -//     view = new WebView(tab); -//     page = view->page(); +    tab = new WebTab; +    view = tab->view(); +    page = tab->page();  }  void WebPageTest::cleanupTestCase()  { -//     delete tab; +    delete tab;  } @@ -119,5 +120,5 @@ void WebPageTest::loadFinished()  // ------------------------------------------- -QTEST_MAIN(WebPageTest) +QTEST_KDEMAIN(WebPageTest,GUI)  #include "webpage_test.moc" diff --git a/src/tests/websnap_test.cpp b/src/tests/websnap_test.cpp index 9c648370..e77e365b 100644 --- a/src/tests/websnap_test.cpp +++ b/src/tests/websnap_test.cpp @@ -21,8 +21,9 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> +#include <QtGui> +#include <QtTest>  #include <QtWebKit>  #include "websnap.h" @@ -49,11 +50,13 @@ private:  void WebSnapTest::initTestCase()  { +//     snap = new WebSnap;  }  void WebSnapTest::cleanupTestCase()  { +    delete snap;  } @@ -63,5 +66,5 @@ void WebSnapTest::cleanupTestCase()  // ------------------------------------------- -QTEST_MAIN(WebSnapTest) +QTEST_KDEMAIN(WebSnapTest,GUI)  #include "websnap_test.moc" diff --git a/src/tests/webtab_test.cpp b/src/tests/webtab_test.cpp index 42d5388b..2c6edf35 100644 --- a/src/tests/webtab_test.cpp +++ b/src/tests/webtab_test.cpp @@ -21,8 +21,9 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> +#include <QtGui> +#include <QtTest>  #include <QtWebKit>  #include "webpage.h" @@ -48,13 +49,13 @@ private:  void WebTabTest::initTestCase()  { -//     tab = new WebTab; +    tab = new WebTab;  }  void WebTabTest::cleanupTestCase()  { -//     delete tab; +    delete tab;  } @@ -63,5 +64,5 @@ void WebTabTest::cleanupTestCase()  // ------------------------------------------- -QTEST_MAIN(WebTabTest) +QTEST_KDEMAIN(WebTabTest,GUI)  #include "webtab_test.moc" diff --git a/src/tests/webview_test.cpp b/src/tests/webview_test.cpp index 82334a30..92431d96 100644 --- a/src/tests/webview_test.cpp +++ b/src/tests/webview_test.cpp @@ -21,12 +21,13 @@  #include <qtest_kde.h> -#include <QtTest>  #include <QtCore> +#include <QtGui> +#include <QtTest>  #include <QtWebKit>  #include "webview.h" - +#include "webtab.h"  class WebViewTest : public QObject  { @@ -40,6 +41,7 @@ private slots:  private:      WebView *view; +    WebTab *tab;  }; @@ -48,6 +50,8 @@ private:  void WebViewTest::initTestCase()  { +    tab = new WebTab; +    view = tab->view();  } @@ -61,5 +65,5 @@ void WebViewTest::cleanupTestCase()  // ------------------------------------------- -QTEST_MAIN(WebViewTest) +QTEST_KDEMAIN(WebViewTest,GUI)  #include "webview_test.moc" | 
