From 28c51f343c210d012b2b5932d78e5f92601d7328 Mon Sep 17 00:00:00 2001 From: megabigbug Date: Sun, 21 Feb 2010 12:49:40 +0100 Subject: add an url with japanese chars for test kget download --- src/tests/link_test.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/tests') diff --git a/src/tests/link_test.html b/src/tests/link_test.html index 7dd1470d..5ca3cd41 100644 --- a/src/tests/link_test.html +++ b/src/tests/link_test.html @@ -135,6 +135,13 @@ link + + +http://ja.wikipedia.org/wiki/特別:最近の更新 +KGet import links with particular encoding +link + + -- cgit v1.2.1 From 723a8850299e2732a4ace01f12a50f6b7e78561c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 26 Feb 2010 11:20:16 +0100 Subject: Fixing scripts and tests to start reloading them.. --- src/tests/CMakeLists.txt | 16 ++++++++-------- src/tests/tabbar_test.cpp | 36 ++++++++++++++---------------------- 2 files changed, 22 insertions(+), 30 deletions(-) (limited to 'src/tests') diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 5df23e24..18de9299 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -20,13 +20,13 @@ target_link_libraries( tabbar_test ##### ------------- mainview test -kde4_add_unit_test( mainview_test mainview_test.cpp ) - -target_link_libraries( mainview_test - kdeinit_rekonq - ${KDE4_KDECORE_LIBS} - ${KDE4_KDEUI_LIBS} - ${QT_QTTEST_LIBRARY} -) +# kde4_add_unit_test( mainview_test mainview_test.cpp ) +# +# target_link_libraries( mainview_test +# kdeinit_rekonq +# ${KDE4_KDECORE_LIBS} +# ${KDE4_KDEUI_LIBS} +# ${QT_QTTEST_LIBRARY} +# ) ############################################################ diff --git a/src/tests/tabbar_test.cpp b/src/tests/tabbar_test.cpp index 08f295d1..7162e6a4 100644 --- a/src/tests/tabbar_test.cpp +++ b/src/tests/tabbar_test.cpp @@ -50,32 +50,23 @@ private slots: class SubTabBar : public TabBar { public: - void call_cloneTab(int index) - { return SubTabBar::cloneTab(index); } - - void call_closeOtherTabs(int index) - { return SubTabBar::closeOtherTabs(index); } - - void call_closeTab(int index) - { return SubTabBar::closeTab(index); } + + SubTabBar(QWidget *parent) : TabBar(parent) {}; + QSize call_tabSizeHint(int index) const + { return SubTabBar::tabSizeHint(index); } + void call_mouseMoveEvent(QMouseEvent* event) { return SubTabBar::mouseMoveEvent(event); } - + + void call_leaveEvent(QEvent* event) + { return SubTabBar::leaveEvent(event); } + void call_mousePressEvent(QMouseEvent* event) { return SubTabBar::mousePressEvent(event); } - - void call_reloadAllTabs() - { return SubTabBar::reloadAllTabs(); } - - void call_reloadTab(int index) - { return SubTabBar::reloadTab(index); } - - QSize call_tabSizeHint(int index) const - { return SubTabBar::tabSizeHint(index); } - - void call_showTabPreview(int tab) - { return SubTabBar::showTabPreview(tab); } + + void call_mouseReleaseEvent(QMouseEvent* event) + { return SubTabBar::mouseReleaseEvent(event); } }; @@ -113,7 +104,8 @@ void TabBarTest::tabbar_data() void TabBarTest::tabbar() { - SubTabBar widget; + QWidget *w = new QWidget; + SubTabBar widget(w); } // ------------------------------------------- -- cgit v1.2.1 From 0f1dfeac60cdf35e44838b1323d98db8383738c7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 27 Feb 2010 15:29:58 +0100 Subject: New (embrional) unit tests: mainview, tabbar, webtab, webpage --- src/tests/CMakeLists.txt | 49 ++++++++++++++---- src/tests/mainview_test.cpp | 47 ++++++++--------- src/tests/tabbar_test.cpp | 107 ++++++++++++++++++++------------------ src/tests/webpage_test.cpp | 123 ++++++++++++++++++++++++++++++++++++++++++++ src/tests/webtab_test.cpp | 67 ++++++++++++++++++++++++ 5 files changed, 311 insertions(+), 82 deletions(-) create mode 100644 src/tests/webpage_test.cpp create mode 100644 src/tests/webtab_test.cpp (limited to 'src/tests') diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 18de9299..ccb25551 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -2,7 +2,14 @@ SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) -INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_BINARY_DIR}/.. +INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../adblock + ${CMAKE_CURRENT_SOURCE_DIR}/../bookmarks + ${CMAKE_CURRENT_SOURCE_DIR}/../history + ${CMAKE_CURRENT_SOURCE_DIR}/../rekonqpage + ${CMAKE_CURRENT_SOURCE_DIR}/../settings + ${CMAKE_CURRENT_SOURCE_DIR}/../urlbar ${KDE4_INCLUDES} ${QT4_INCLUDES} ) @@ -20,13 +27,37 @@ target_link_libraries( tabbar_test ##### ------------- mainview test -# kde4_add_unit_test( mainview_test mainview_test.cpp ) -# -# target_link_libraries( mainview_test -# kdeinit_rekonq -# ${KDE4_KDECORE_LIBS} -# ${KDE4_KDEUI_LIBS} -# ${QT_QTTEST_LIBRARY} -# ) +kde4_add_unit_test( mainview_test mainview_test.cpp ) + +target_link_libraries( mainview_test + kdeinit_rekonq + ${KDE4_KDECORE_LIBS} + ${KDE4_KDEUI_LIBS} + ${QT_QTTEST_LIBRARY} +) + +##### ------------- webpage test + +kde4_add_unit_test( webpage_test webpage_test.cpp ) + +target_link_libraries( webpage_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 ) + +target_link_libraries( webtab_test + kdeinit_rekonq + ${KDE4_KDECORE_LIBS} + ${KDE4_KDEUI_LIBS} + ${KDE4_KDEWEBKIT_LIBS} + ${QT_QTTEST_LIBRARY} +) ############################################################ diff --git a/src/tests/mainview_test.cpp b/src/tests/mainview_test.cpp index f56d73ab..1dfffcbe 100644 --- a/src/tests/mainview_test.cpp +++ b/src/tests/mainview_test.cpp @@ -31,8 +31,21 @@ #include #include -#include "../mainview.h" -#include "../webview.h" +#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 @@ -42,8 +55,6 @@ class MainViewTest : public QObject public slots: void initTestCase(); void cleanupTestCase(); - void init(); - void cleanup(); private slots: void tabwidget_data(); @@ -75,38 +86,30 @@ private slots: void currentChanged_data(); void currentChanged(); + +private: + MainWindow *mainWindow; + SubMainView *mainView; }; -// Subclass that exposes the protected functions. -class SubMainView : public MainView -{ -public: - void call_resizeEvent(QResizeEvent *event) - { return SubMainView::resizeEvent(event); } -}; +// ------------------------------------------------------------------------------- // This will be called before the first test function is executed. // It is only called once. void MainViewTest::initTestCase() { + 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() { -} - -// This will be called before each test function is executed. -void MainViewTest::init() -{ -} - -// This will be called after every test function. -void MainViewTest::cleanup() -{ + delete mainView; + delete mainWindow; } // ------------------------------------------- @@ -117,7 +120,6 @@ void MainViewTest::tabwidget_data() void MainViewTest::tabwidget() { - SubMainView widget; // widget.currentWebView(); // QCOMPARE(widget.currentIndex(), 0); // widget.newTab(); @@ -140,7 +142,6 @@ void MainViewTest::closeTab() { QFETCH(int, index); - SubMainView widget; /* QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); diff --git a/src/tests/tabbar_test.cpp b/src/tests/tabbar_test.cpp index 7162e6a4..560f2c9b 100644 --- a/src/tests/tabbar_test.cpp +++ b/src/tests/tabbar_test.cpp @@ -24,29 +24,14 @@ #include #include -#include "../tabbar.h" +#include "mainwindow.h" +#include "mainview.h" +#include "tabbar.h" -class TabBarTest : public QObject -{ - Q_OBJECT - -public slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - -private slots: - void tabbar_data(); - void tabbar(); - - void tabSizeHint_data(); - void tabSizeHint(); -}; - - -// Subclass that exposes the protected functions. +/** + * Subclass that exposes the protected functions. + */ class SubTabBar : public TabBar { public: @@ -70,62 +55,84 @@ public: }; -// This will be called before the first test function is executed. -// It is only called once. -void TabBarTest::initTestCase() -{ -} +// ------------------------------------------------------------------ -// This will be called after the last test function is executed. -// It is only called once. -void TabBarTest::cleanupTestCase() +class TabBarTest : public QObject { -} + Q_OBJECT +public slots: + void initTestCase(); + void cleanupTestCase(); + +private slots: + void tabSizeHint_data(); + void tabSizeHint(); + + void mousePress_data(); + void mousePress(); + +private: + SubTabBar *_bar; +}; + + +// ------------------------------------------- -// This will be called before each test function is executed. -void TabBarTest::init() +void TabBarTest::initTestCase() { + MainWindow *w = new MainWindow; + MainView *mv = new MainView(w); + _bar = new SubTabBar(mv); } - -// This will be called after every test function. -void TabBarTest::cleanup() +void TabBarTest::cleanupTestCase() { + delete _bar; } // ------------------------------------------- -void TabBarTest::tabbar_data() +void TabBarTest::tabSizeHint_data() { + QTest::addColumn("index"); + + QTest::newRow("1th") << 0; + QTest::newRow("2nd") << 1; + QTest::newRow("3rd") << 2; + QTest::newRow("4th") << 3; + QTest::newRow("5th") << 4; + QTest::newRow("6th") << 5; + QTest::newRow("7th") << 6; + QTest::newRow("8th") << 7; + QTest::newRow("9th") << 8; + QTest::newRow("10th") << 9; } -void TabBarTest::tabbar() +void TabBarTest::tabSizeHint() { - QWidget *w = new QWidget; - SubTabBar widget(w); + QFETCH(int, index); + + QVERIFY(_bar->call_tabSizeHint(index).width() > 0); } -// ------------------------------------------- -void TabBarTest::tabSizeHint_data() +void TabBarTest::mousePress_data() { -// QTest::addColumn("index"); -// QTest::newRow("0") << 0; } -// protected QSize tabSizeHint(int index) const -void TabBarTest::tabSizeHint() +void TabBarTest::mousePress() { - // Need fixes as our function uses MainView methods to determine size -// QFETCH(int, index); -// SubTabBar bar; -// QVERIFY(bar.call_tabSizeHint(index).width() <= 250); +// QTest::mousePress(_bar, Qt::MidButton); +// // QCOMPARE(); ? +// +// QTest::mousePress(_bar, Qt::LeftButton); +// // QCOMPARE(); ? } - + // ------------------------------------------- QTEST_KDEMAIN(TabBarTest, GUI) diff --git a/src/tests/webpage_test.cpp b/src/tests/webpage_test.cpp new file mode 100644 index 00000000..7afb5502 --- /dev/null +++ b/src/tests/webpage_test.cpp @@ -0,0 +1,123 @@ +/* + * Copyright 2010 Andrea Diamantini + * + * 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 + +#include +#include +#include + +#include "webpage.h" +#include "webview.h" +#include "webtab.h" + + +class WebPageTest : public QObject +{ + Q_OBJECT + +public: + WebPageTest(); + virtual ~WebPageTest(); + +public slots: + void initTestCase(); + void cleanupTestCase(); + +private slots: + void manageNetworkErrors(); + void downloadRequest(); + void downloadAllContentsWithKGet(); + + void createWindow(); + void acceptNavigationRequest(); + + void handleUnsupportedContent(); + + void loadFinished(); + +private: + WebTab *tab; + WebPage *page; + WebView *view; +}; + + +// ------------------------------------------- + + +WebPageTest::WebPageTest() +{} + + +WebPageTest::~WebPageTest() +{} + + +void WebPageTest::initTestCase() +{ + tab = new WebTab; + view = new WebView(tab); + page = view->page(); +} + + +void WebPageTest::cleanupTestCase() +{ + delete tab; +} + + +// ------------------------------------------- + + +void WebPageTest::manageNetworkErrors() +{ +} + +void WebPageTest::downloadRequest() +{ +} + +void WebPageTest::downloadAllContentsWithKGet() +{ +} + +void WebPageTest::createWindow() +{ +} + +void WebPageTest::acceptNavigationRequest() +{ +} + +void WebPageTest::handleUnsupportedContent() +{ +} + +void WebPageTest::loadFinished() +{ +} + +// ------------------------------------------- + +QTEST_MAIN(WebPageTest) +#include "webpage_test.moc" diff --git a/src/tests/webtab_test.cpp b/src/tests/webtab_test.cpp new file mode 100644 index 00000000..ae5647f3 --- /dev/null +++ b/src/tests/webtab_test.cpp @@ -0,0 +1,67 @@ +/* + * Copyright 2010 Andrea Diamantini + * + * 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 + +#include +#include +#include + +#include "webpage.h" +#include "webview.h" +#include "webtab.h" + + +class WebTabTest : public QObject +{ + Q_OBJECT + +public slots: + void initTestCase(); + void cleanupTestCase(); + +private: + WebTab *tab; +}; + + +// ------------------------------------------- + + +void WebTabTest::initTestCase() +{ + tab = new WebTab; +} + + +void WebTabTest::cleanupTestCase() +{ + delete tab; +} + + +// ------------------------------------------- + + +// ------------------------------------------- + +QTEST_MAIN(WebTabTest) +#include "webtab_test.moc" -- cgit v1.2.1 From d897ce42be8375ffab89615ab3953b8bd3ab3bbc Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 12:22:25 +0100 Subject: All the other (blank) tests.. --- src/tests/CMakeLists.txt | 97 ++++++++++++++++++++++++++++++++- src/tests/findbar_test.cpp | 64 ++++++++++++++++++++++ src/tests/mainview_test.cpp | 8 +-- src/tests/mainwindow_test.cpp | 62 +++++++++++++++++++++ src/tests/networkaccessmanager_test.cpp | 65 ++++++++++++++++++++++ src/tests/protocolhandler_test.cpp | 65 ++++++++++++++++++++++ src/tests/sessionmanager_test.cpp | 66 ++++++++++++++++++++++ src/tests/walletbar_test.cpp | 66 ++++++++++++++++++++++ src/tests/webpage_test.cpp | 8 +-- src/tests/websnap_test.cpp | 67 +++++++++++++++++++++++ src/tests/webtab_test.cpp | 4 +- src/tests/webview_test.cpp | 65 ++++++++++++++++++++++ 12 files changed, 624 insertions(+), 13 deletions(-) create mode 100644 src/tests/findbar_test.cpp create mode 100644 src/tests/mainwindow_test.cpp create mode 100644 src/tests/networkaccessmanager_test.cpp create mode 100644 src/tests/protocolhandler_test.cpp create mode 100644 src/tests/sessionmanager_test.cpp create mode 100644 src/tests/walletbar_test.cpp create mode 100644 src/tests/websnap_test.cpp create mode 100644 src/tests/webview_test.cpp (limited to 'src/tests') 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 + * + * 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 + +#include +#include +#include + +#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 + * + * 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 + +#include +#include +#include + +#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 + * + * 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 + +#include +#include +#include + +#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 + * + * 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 + +#include +#include +#include + +#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 + * + * 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 + +#include +#include +#include + +#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 + * + * 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 + +#include +#include +#include + +#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 + * + * 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 + +#include +#include +#include + +#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 + * + * 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 + +#include +#include +#include + +#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" -- cgit v1.2.1 From 24a64d92d7444829edb77ba50ac618b6b0067b9d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 12:36:32 +0100 Subject: Changing Findbar parent --- src/tests/findbar_test.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/tests') diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp index 0e332b6a..3fb0e244 100644 --- a/src/tests/findbar_test.cpp +++ b/src/tests/findbar_test.cpp @@ -26,7 +26,7 @@ #include #include "findbar.h" - +#include "mainwindow.h" class FindBarTest : public QObject @@ -38,7 +38,8 @@ public slots: void cleanupTestCase(); private slots: - + void matchCase(); + void notifyMatch(); private: FindBar *bar; @@ -50,13 +51,23 @@ private: void FindBarTest::initTestCase() { + MainWindow *w = new MainWindow; + bar = new FindBar(w); } void FindBarTest::cleanupTestCase() { + delete bar; } +void FindBarTest::matchCase() +{ +} + +void FindBarTest::notifyMatch() +{ +} // ------------------------------------------- -- cgit v1.2.1 From e5e4ffa0e844c4f1cbe40eeaa309c4711c1073e6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 17:05:37 +0100 Subject: 10 (of 12) tests working and ready to be "expanded".. --- src/tests/CMakeLists.txt | 1 + src/tests/findbar_test.cpp | 10 +++++----- src/tests/mainview_test.cpp | 26 ++++++-------------------- src/tests/mainwindow_test.cpp | 9 ++++++--- src/tests/networkaccessmanager_test.cpp | 8 +++++--- src/tests/protocolhandler_test.cpp | 9 ++++++--- src/tests/sessionmanager_test.cpp | 9 ++++++--- src/tests/walletbar_test.cpp | 9 ++++++--- src/tests/webpage_test.cpp | 13 +++++++------ src/tests/websnap_test.cpp | 7 +++++-- src/tests/webtab_test.cpp | 9 +++++---- src/tests/webview_test.cpp | 10 +++++++--- 12 files changed, 65 insertions(+), 55 deletions(-) (limited to 'src/tests') 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 -#include -#include -#include +#include +#include #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 -#include #include #include +#include #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 -#include #include -#include +#include +#include #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 -#include #include -#include +#include +#include #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 -#include #include -#include +#include +#include + #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 -#include #include -#include +#include +#include + #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 -#include #include -#include +#include +#include #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 -#include #include +#include +#include #include #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 -#include #include +#include +#include #include #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 -#include #include +#include +#include #include #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 -#include #include +#include +#include #include #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" -- cgit v1.2.1 From fbf6f37706a66bff0b61e0b854e3c4e123387db6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 17:07:05 +0100 Subject: Ok, commenting out (for now) problems with 2 failing tests.. --- src/tests/mainview_test.cpp | 7 ++++--- src/tests/mainwindow_test.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/tests') diff --git a/src/tests/mainview_test.cpp b/src/tests/mainview_test.cpp index 30d4e7dd..80fecaa2 100644 --- a/src/tests/mainview_test.cpp +++ b/src/tests/mainview_test.cpp @@ -31,6 +31,7 @@ #include #include +#include "mainwindow.h" #include "mainview.h" #include "webview.h" @@ -87,15 +88,15 @@ private: // It is only called once. void MainViewTest::initTestCase() { - window = new MainWindow; - view = window->mainView(); +// 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 window; +// delete window; } // ------------------------------------------- diff --git a/src/tests/mainwindow_test.cpp b/src/tests/mainwindow_test.cpp index 90ae26bd..a37e9f16 100644 --- a/src/tests/mainwindow_test.cpp +++ b/src/tests/mainwindow_test.cpp @@ -50,13 +50,13 @@ private: void MainWindowTest::initTestCase() { - window = new MainWindow; +// window = new MainWindow; } void MainWindowTest::cleanupTestCase() { - delete window; +// delete window; } // ------------------------------------------- -- cgit v1.2.1 From d61a0d580b3f2835ab0292aecac8ebbdce8bec41 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 17:12:09 +0100 Subject: Ok, we have 12 empty tests working... :) --- src/tests/mainview_test.cpp | 4 ++-- src/tests/mainwindow_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tests') diff --git a/src/tests/mainview_test.cpp b/src/tests/mainview_test.cpp index 80fecaa2..94e7fc30 100644 --- a/src/tests/mainview_test.cpp +++ b/src/tests/mainview_test.cpp @@ -88,8 +88,8 @@ private: // It is only called once. void MainViewTest::initTestCase() { -// window = new MainWindow; -// view = window->mainView(); + window = new MainWindow; + view = window->mainView(); } // This will be called after the last test function is executed. diff --git a/src/tests/mainwindow_test.cpp b/src/tests/mainwindow_test.cpp index a37e9f16..d3ab6bef 100644 --- a/src/tests/mainwindow_test.cpp +++ b/src/tests/mainwindow_test.cpp @@ -50,7 +50,7 @@ private: void MainWindowTest::initTestCase() { -// window = new MainWindow; + window = new MainWindow; } -- cgit v1.2.1 From edea0f2fc34738de52a58f00c676e814f7a8c2fd Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 23:58:31 +0100 Subject: First works on new Unit Tests.. --- src/tests/CMakeLists.txt | 1 + src/tests/findbar_test.cpp | 1 + src/tests/mainview_test.cpp | 183 ++++++++++++++++++------------------- src/tests/protocolhandler_test.cpp | 52 ++++++++++- src/tests/webpage_test.cpp | 12 --- src/tests/websnap_test.cpp | 1 - src/tests/webview_test.cpp | 2 + 7 files changed, 141 insertions(+), 111 deletions(-) (limited to 'src/tests') diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 0230a5ce..e05a056b 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -67,6 +67,7 @@ target_link_libraries( protocolhandler_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 index 6b81255f..a79f44a2 100644 --- a/src/tests/findbar_test.cpp +++ b/src/tests/findbar_test.cpp @@ -63,6 +63,7 @@ void FindBarTest::cleanupTestCase() void FindBarTest::matchCase() { + } void FindBarTest::notifyMatch() diff --git a/src/tests/mainview_test.cpp b/src/tests/mainview_test.cpp index 94e7fc30..596ac4e1 100644 --- a/src/tests/mainview_test.cpp +++ b/src/tests/mainview_test.cpp @@ -96,7 +96,7 @@ void MainViewTest::initTestCase() // It is only called once. void MainViewTest::cleanupTestCase() { -// delete window; +// delete window; // FIXME: this let the test fail. Why?? } // ------------------------------------------- @@ -107,13 +107,16 @@ void MainViewTest::tabwidget_data() void MainViewTest::tabwidget() { -// widget.currentWebView(); -// QCOMPARE(widget.currentIndex(), 0); -// widget.newTab(); -// widget.nextTab(); -// QCOMPARE(widget.currentIndex(), 1); -// widget.previousTab(); -// QCOMPARE(widget.currentIndex(), 0); + QCOMPARE(view->currentIndex(), -1); + +// view->newTab(); +// QCOMPARE(view->currentIndex(), 1); +// view->newTab(); +// view->nextTab(); +// QCOMPARE(view->currentIndex(), 0); +// +// view->previousTab(); +// QCOMPARE(view->currentIndex(), 0); } // ------------------------------------------- @@ -124,32 +127,30 @@ void MainViewTest::closeTab_data() QTest::newRow("null") << 0; } -// public void closeTab(int index = -1) + void MainViewTest::closeTab() { - QFETCH(int, index); - -/* - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); -QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); - - widget.newTab(); - widget.slotCloseTab(index); - widget.newTab(); - widget.slotCloseTab(index); - widget.newTab(); - - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy3.count(), 2); - QCOMPARE(spy5.count(), 0); - QCOMPARE(spy6.count(), 0);*/ +// QFETCH(int, index); +// +// QSignalSpy spy1(view, SIGNAL(linkHovered(const QString &))); +// QSignalSpy spy2(view, SIGNAL(setCurrentTitle(const QString &))); +// QSignalSpy spy3(view, SIGNAL(tabsChanged())); +// QSignalSpy spy4(view, SIGNAL(lastTabClosed())); +// +// view->newTab(); +// view->closeTab(index); +// view->newTab(); +// view->closeTab(index); +// view->newTab(); +// +// QCOMPARE(spy1.count(), 0); +// QCOMPARE(spy2.count(), 2); +// QCOMPARE(spy3.count(), 0); +// QCOMPARE(spy4.count(), 0); } // ------------------------------------------- -Q_DECLARE_METATYPE(WebView*) void MainViewTest::currentWebView_data() { /* @@ -158,7 +159,6 @@ void MainViewTest::currentWebView_data() */ } -// public WebView *currentWebView() const void MainViewTest::currentWebView() { /* @@ -166,12 +166,12 @@ void MainViewTest::currentWebView() SubMainView widget; - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); + QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); + QSignalSpy spy2(view, SIGNAL(loadProgress(int))); + QSignalSpy spy3(view, SIGNAL(setCurrentTitle(const QString &))); + QSignalSpy spy4(view, SIGNAL(showStatusBarMessage(const QString &))); + QSignalSpy spy5(view, SIGNAL(tabsChanged())); + QSignalSpy spy6(view, SIGNAL(lastTabClosed())); QCOMPARE(widget.currentWebView(), currentWebView); @@ -193,31 +193,24 @@ void MainViewTest::newTab_data() QTest::newRow("null") << 0; } -// public void newTab() + void MainViewTest::newTab() { - /* - QFETCH(int, foo); - - SubMainView widget; - - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); - - widget.newTab(); - - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy2.count(), 0); - QCOMPARE(spy3.count(), 0); - QCOMPARE(spy4.count(), 0); - QCOMPARE(spy5.count(), 0); - QCOMPARE(spy6.count(), 0); - */ - QSKIP("Test is not implemented.", SkipAll); +// QFETCH(int, foo); +// +// QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); +// QSignalSpy spy1(view, SIGNAL(setCurrentTitle(const QString &))); +// QSignalSpy spy2(view, SIGNAL(showStatusBarMessage(const QString &))); +// QSignalSpy spy3(view, SIGNAL(tabsChanged())); +// QSignalSpy spy4(view, SIGNAL(lastTabClosed())); +// +// view->newTab(); +// +// QCOMPARE(spy0.count(), 0); +// QCOMPARE(spy1.count(), 0); +// QCOMPARE(spy2.count(), 0); +// QCOMPARE(spy3.count(), 0); +// QCOMPARE(spy4.count(), 0); } // ------------------------------------------- @@ -236,12 +229,12 @@ void MainViewTest::nextTab() SubMainView widget; - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); + QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); + QSignalSpy spy2(view, SIGNAL(loadProgress(int))); + QSignalSpy spy3(view, SIGNAL(setCurrentTitle(const QString &))); + QSignalSpy spy4(view, SIGNAL(showStatusBarMessage(const QString &))); + QSignalSpy spy5(view, SIGNAL(tabsChanged())); + QSignalSpy spy6(view, SIGNAL(lastTabClosed())); widget.nextTab(); @@ -272,12 +265,12 @@ void MainViewTest::previousTab() SubMainView widget; - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); + QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); + QSignalSpy spy2(view, SIGNAL(loadProgress(int))); + QSignalSpy spy3(view, SIGNAL(setCurrentTitle(const QString &))); + QSignalSpy spy4(view, SIGNAL(showStatusBarMessage(const QString &))); + QSignalSpy spy5(view, SIGNAL(tabsChanged())); + QSignalSpy spy6(view, SIGNAL(lastTabClosed())); widget.previousTab(); @@ -302,12 +295,12 @@ void MainViewTest::recentlyClosedTabs() /* SubMainView widget; - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); + QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); + QSignalSpy spy2(view, SIGNAL(loadProgress(int))); + QSignalSpy spy3(view, SIGNAL(setCurrentTitle(const QString &))); + QSignalSpy spy4(view, SIGNAL(showStatusBarMessage(const QString &))); + QSignalSpy spy5(view, SIGNAL(tabsChanged())); + QSignalSpy spy6(view, SIGNAL(lastTabClosed())); QCOMPARE(spy0.count(), 0); QCOMPARE(spy2.count(), 0); @@ -335,12 +328,12 @@ void MainViewTest::setCurrentTitle(const QString &) SubMainView widget; - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); + QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); + QSignalSpy spy2(view, SIGNAL(loadProgress(int))); + QSignalSpy spy3(view, SIGNAL(setCurrentTitle(const QString &))); + QSignalSpy spy4(view, SIGNAL(showStatusBarMessage(const QString &))); + QSignalSpy spy5(view, SIGNAL(tabsChanged())); + QSignalSpy spy6(view, SIGNAL(lastTabClosed())); widget.call_setCurrentTitle(url); @@ -370,12 +363,12 @@ void MainViewTest::showStatusBarMessage(const QString &) SubMainView widget; - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); + QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); + QSignalSpy spy2(view, SIGNAL(loadProgress(int))); + QSignalSpy spy3(view, SIGNAL(setCurrentTitle(const QString &))); + QSignalSpy spy4(view, SIGNAL(showStatusBarMessage(const QString &))); + QSignalSpy spy5(view, SIGNAL(tabsChanged())); + QSignalSpy spy6(view, SIGNAL(lastTabClosed())); widget.call_showStatusBarMessage(message); @@ -391,14 +384,12 @@ void MainViewTest::showStatusBarMessage(const QString &) // ------------------------------------------- -// void slotCurrentChanged(int index); void MainViewTest::currentChanged_data() { QTest::addColumn("foo"); QTest::newRow("null") << 0; } -// private slotCurrentChanged void MainViewTest::currentChanged() { /* @@ -406,12 +397,12 @@ void MainViewTest::currentChanged() SubMainView widget; - QSignalSpy spy0(&widget, SIGNAL(linkHovered(const QString &))); - QSignalSpy spy2(&widget, SIGNAL(loadProgress(int))); - QSignalSpy spy3(&widget, SIGNAL(setCurrentTitle(const QString &))); - QSignalSpy spy4(&widget, SIGNAL(showStatusBarMessage(const QString &))); - QSignalSpy spy5(&widget, SIGNAL(tabsChanged())); - QSignalSpy spy6(&widget, SIGNAL(lastTabClosed())); + QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &))); + QSignalSpy spy2(view, SIGNAL(loadProgress(int))); + QSignalSpy spy3(view, SIGNAL(setCurrentTitle(const QString &))); + QSignalSpy spy4(view, SIGNAL(showStatusBarMessage(const QString &))); + QSignalSpy spy5(view, SIGNAL(tabsChanged())); + QSignalSpy spy6(view, SIGNAL(lastTabClosed())); widget.call_tabsChanged(); 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 #include #include - +#include #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("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("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) diff --git a/src/tests/webpage_test.cpp b/src/tests/webpage_test.cpp index 3527f1ed..3051b8bf 100644 --- a/src/tests/webpage_test.cpp +++ b/src/tests/webpage_test.cpp @@ -34,10 +34,6 @@ class WebPageTest : public QObject { Q_OBJECT - -public: - WebPageTest(); - virtual ~WebPageTest(); public slots: void initTestCase(); @@ -65,14 +61,6 @@ private: // ------------------------------------------- -WebPageTest::WebPageTest() -{} - - -WebPageTest::~WebPageTest() -{} - - void WebPageTest::initTestCase() { tab = new WebTab; diff --git a/src/tests/websnap_test.cpp b/src/tests/websnap_test.cpp index e77e365b..53fc1d4f 100644 --- a/src/tests/websnap_test.cpp +++ b/src/tests/websnap_test.cpp @@ -50,7 +50,6 @@ private: void WebSnapTest::initTestCase() { -// snap = new WebSnap; } diff --git a/src/tests/webview_test.cpp b/src/tests/webview_test.cpp index 92431d96..11d1a46c 100644 --- a/src/tests/webview_test.cpp +++ b/src/tests/webview_test.cpp @@ -29,6 +29,7 @@ #include "webview.h" #include "webtab.h" + class WebViewTest : public QObject { Q_OBJECT @@ -57,6 +58,7 @@ void WebViewTest::initTestCase() void WebViewTest::cleanupTestCase() { + delete tab; } -- cgit v1.2.1 From 858acb145fdcd6ea7a28739e55d4666b3e33f24b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 1 Mar 2010 23:05:01 +0100 Subject: Added shortlink to GreenBytes HTTP tests --- src/tests/HTTP_tests.html | 601 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 601 insertions(+) create mode 100644 src/tests/HTTP_tests.html (limited to 'src/tests') diff --git a/src/tests/HTTP_tests.html b/src/tests/HTTP_tests.html new file mode 100644 index 00000000..7a5ac00d --- /dev/null +++ b/src/tests/HTTP_tests.html @@ -0,0 +1,601 @@ + + + + +Test Cases for HTTP Content-Disposition header and RFC 2231/2047 Encoding + + + + + + + +

Test Cases for HTTP Content-Disposition header and RFC 2231/2047 Encoding

+ + +

Test Cases

Content-Disposition: Disposition-Type Inline

+

+ Various tests relating to the "inline" disposition type, see + Section 2.1 of RFC 2183. +

+

inlonly + [TEST] +

Content-Disposition: inline
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromepass

'inline' only

This should be equivalent to not including the header at all.

inlwithasciifilename + [TEST] +

Content-Disposition: inline; filename="foo.html"
+ Test Results +
FF3pass + (uses the filename in subsequent 'save' operation) +
MSIE8pass + (filename information not used) +
Op10pass + (filename information not used) +
Saf4pass + (filename information not used) +
Konqpass + (filename information not used) +
Chromepass + (filename information not used) +

+ 'inline', specifying a filename of foo.html +

+ Some UAs use this filename in a subsequent "save" operation. +

inlwithasciifilenamepdf + [TEST] +

Content-Disposition: inline; filename="foo.pdf"
+ Test Results +
FF3pass + (filename information not used) +
MSIE8pass + (filename information not used) +
Op10pass + (filename information not used) +
Saf4pass + (filename information not used) +
Konqpass + (filename information not used) +
Chromepass + (filename information not used) +

+ 'inline', specifying a filename of foo.pdf +

+ Some UAs use this filename in a subsequent "save" operation. + This variation of the test checks whether whatever handles PDF display + receives the filename information, and acts upon it + (this was tested with the latest Acrobat Reader plugin). +

Content-Disposition: Disposition-Type Attachment

+

+ Various tests relating to the "attchment" disposition type, see + Section 2.2 of RFC 2183. +

+

attonly + [TEST] +

Content-Disposition: attachment
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromepass

'attachment' only

UA should offer to download the resource.

attonlyucase + [TEST] +

Content-Disposition: ATTACHMENT
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqfail
Chromepass

'ATTACHMENT' only

UA should offer to download the resource.

attwithasciifilename + [TEST] +

Content-Disposition: attachment; filename="foo.html"
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromepass

+ 'attachment', specifying a filename of foo.html +

UA should offer to download the resource as "foo.html".

attwithasciifnescapedchar + [TEST] +

Content-Disposition: attachment; filename="f\oo.html"
+ Test Results +
FF3fail + (apparently does not treat the backslash as escape character, replaces it with '_') +
MSIE8fail + (apparently does not treat the backslash as escape character, replaces it with '_') +
Op10pass
Saf4fail + (apparently does not treat the backslash as escape character, replaces it with '-') +
Konqpass
Chromefail + (saves "oo.html" (what's going on here?)) +

+ 'attachment', specifying a filename of f\oo.html (the first 'o' being escaped) +

UA should offer to download the resource as "foo.html".

attwithfilenameandextparam + [TEST] +

Content-Disposition: attachment; foo="bar"; filename="foo.html"
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromepass

+ 'attachment', specifying a filename of foo.html + and an extension parameter "foo" which should be ignored + (see Section 2.8 of RFC 2183.). +

UA should offer to download the resource as "foo.html".

attwithasciifilenameucase + [TEST] +

Content-Disposition: attachment; FILENAME="foo.html"
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqfail + (filename parameter is ignored) +
Chromepass

+ 'attachment', specifying a filename of foo.html +

UA should offer to download the resource as "foo.html".

attwithasciifilenamenq + [TEST] +

Content-Disposition: attachment; filename=foo.html
+ Test Results +
FF3warn + (accepts the unquoted value) +
MSIE8warn + (accepts the unquoted value) +
Op10warn + (accepts the unquoted value) +
Saf4warn + (accepts the unquoted value) +
Konqwarn + (accepts the unquoted value) +
Chromewarn + (accepts the unquoted value) +

+ 'attachment', specifying a filename of foo.html, but missing + the quotes. +

This is invalid according to Section 19.5.1 of RFC2616, so UAs should + ignore it.

attwithisofnplain + [TEST] +

Content-Disposition: attachment; filename="foo-ä.html"
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromepass

+ 'attachment', specifying a filename of foo-ä.html, using plain ISO-8859-1 +

UA should offer to download the resource as "foo-ä.html".

attwithutf8fnplain + [TEST] +

Content-Disposition: attachment; filename="foo-ä.html"
+ Test Results +
FF3fail + (decodes as UTF-8) +
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromefail + (decodes as UTF-8) +

+ 'attachment', specifying a filename of foo-ä.html, + which happens to be foo-ä.html using UTF-8 encoding. +

UA should offer to download the resource as "foo-ä.html". + Displaying "foo-ä.html" instead indicates that the UA tried to be smart by detecting + something that happens to look like UTF-8.

attwithfnrawpctenca + [TEST] +

Content-Disposition: attachment; filename="foo-%41.html"
+ Test Results +
FF3pass
MSIE8fail + (displays "foo-A.html") +
Op10pass
Saf4pass
Konqpass
Chromefail + (displays "foo-A.html" (see Chrome Issue 118)) +

+ 'attachment', specifying a filename of foo-%41.html +

UA should offer to download the resource as "foo-%41.html". + Displaying "foo-A.html" instead would indicate that the UA has attempted + to percent-decode the parameter. +

attwithfnrawpctenclong + [TEST] +

Content-Disposition: attachment; filename="foo-%c3%a4-%e2%82%ac.html"
+ Test Results +
FF3pass
MSIE8fail + (displays "foo-ä-€.html") +
Op10pass
Saf4pass
Konqpass
Chromefail + (displays "foo-ä-€.html" (see Chrome Issue 118)) +

+ 'attachment', specifying a filename of foo-%c3%a4-%e2%82%ac.html, using raw percent encoded UTF-8 + to represent foo-ä-€.html +

UA should offer to download the resource as "foo-%c3%a4-%e2%82%ac.html". + Displaying "foo-ä-€.html" instead would indicate that the UA has attempted + to percent-decode the parameter (using UTF-8). Displaying something else + would indicate that the UA tried to percent-decode, but used a different encoding. +

attwithasciifilenamews1 + [TEST] +

Content-Disposition: attachment; filename ="foo.html"
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromepass

+ 'attachment', specifying a filename of foo.html, with one + blank space before the equals character. +

UA should offer to download the resource as "foo.html".

attwithasciifilenamews2 + [TEST] +

Content-Disposition: attachment; filename= "foo.html"
+ Test Results +
FF3pass
MSIE8pass
Op10pass
Saf4pass
Konqpass
Chromepass

+ 'attachment', specifying a filename of foo.html, with one + blank space after the equals character. +

UA should offer to download the resource as "foo.html".

attfnbrokentoken + [TEST] +

Content-Disposition: attachment; filename=foo[1](2).html
+ Test Results +
FF3warn + (accepts the unquoted value) +
MSIE8warn + (accepts the unquoted value) +
Op10warn + (accepts the unquoted value) +
Saf4warn + (accepts the unquoted value) +
Konqwarn + (accepts the unquoted value) +
Chromewarn + (accepts the unquoted value) +

+ 'attachment', specifying a filename of foo[1](2).html, but missing + the quotes. Also, "[", "]", "(" and ")" are not allowed in the HTTP token + production. +

This is invalid according to Section 19.5.1 of RFC2616, + so UAs should ignore it.

Content-Disposition: Additional Parameters

+

+ Various tests relating to the additional parameters defined in + Section 2 of RFC 2183. +

+

attcdate + [TEST] +

Content-Disposition: attachment; creation-date="Wed, 12 Feb 1997 16:29:51 -0500"
+ Test Results +
FF3unsupported + (seems to ignore the parameter) +
MSIE8unsupported + (seems to ignore the parameter) +
Op10unsupported + (seems to ignore the parameter) +
Saf4unsupported + (seems to ignore the parameter) +
Konqunsupported + (seems to ignore the parameter) +
Chromeunsupported + (seems to ignore the parameter) +

'attachment', plus creation-date (see Section 2.4 of RFC 2183)

UA should offer to download the resource. When doing so, + the creation date should be set to 12 Feb 1997.

attmdate + [TEST] +

Content-Disposition: attachment; modification-date="Wed, 12 Feb 1997 16:29:51 -0500"
+ Test Results +
FF3unsupported + (seems to ignore the parameter) +
MSIE8unsupported + (seems to ignore the parameter) +
Op10unsupported + (seems to ignore the parameter) +
Saf4unsupported + (seems to ignore the parameter) +
Konqunsupported + (seems to ignore the parameter) +
Chromeunsupported + (seems to ignore the parameter) +

'attachment', plus modification-date (see Section 2.5 of RFC 2183)

UA should offer to download the resource. When doing so, + the modification date should be set to 12 Feb 1997.

Content-Disposition: Disposition-Type Extension

+

+ A test checking behavior for disposition type extensions, + which should be treated as "attachment", see + Section 2.8 of RFC 2183. +

+

dispext + [TEST] +

Content-Disposition: foobar
+ Test Results +
FF3pass
MSIE8fail (does not treat it as 'attachment')
Op10fail (does not treat it as 'attachment')
Saf4fail (does not treat it as 'attachment')
Konqfail (does not treat it as 'attachment')
Chromepass

'foobar' only

This should be equivalent to using "attachment".

RFC2231 Encoding: Character Sets

+

+ Various tests using the parameter value encoding defined + in Section 4 of RFC 2231. +

+

attwithisofn2231iso + [TEST] +

Content-Disposition: attachment; filename*=iso-8859-1''foo-%E4.html
+ Test Results +
FF3pass
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using RFC2231 encoded ISO-8859-1 +

UA should offer to download the resource as "foo-ä.html". +

attwithfn2231utf8 + [TEST] +

Content-Disposition: attachment; filename*=UTF-8''foo-%c3%a4-%e2%82%ac.html
+ Test Results +
FF3pass
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä-€.html, using RFC2231 encoded UTF-8 +

UA should offer to download the resource as "foo-ä-€.html". +

attwithfn2231noc + [TEST] +

Content-Disposition: attachment; filename*=''foo-%c3%a4-%e2%82%ac.html
+ Test Results +
FF3warn + (decodes as UTF-8) +
MSIE8unsupported
Op10warn + (decodes as 8bit encoding (ISO-8859-1?)) +
Saf4unsupported
Konqunsupported
Chromeunsupported

+ Behavior is undefined in RFC 2231, the charset part is missing, although UTF-8 was used. +

attwithfn2231utf8comp + [TEST] +

Content-Disposition: attachment; filename*=UTF-8''foo-a%cc%88.html
+ Test Results +
FF3pass
MSIE8unsupported
Op10warn + (displays "foo-ä.html") +
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using RFC2231 encoded UTF-8, but + choosing the decomposed form (lowercase a plus COMBINING DIAERESIS) -- + on a Windows target system, this should be translated to the preferred + Unicode normal form (composed). +

UA should offer to download the resource as "foo-ä.html". +

attwithfn2231utf8-bad + [TEST] +

Content-Disposition: attachment; filename*=iso-8859-1''foo-%c3%a4-%e2%82%ac.html
+ Test Results +
FF3fail + (falls back to UTF-8) +
MSIE8unsupported
Op10warn + (displays the raw octet sequence as if it was ISO-8859-1 (which is internally + treated as windows-1252, which does allow %82)) +
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä-€.html, using RFC2231 encoded UTF-8, but declaring ISO-8859-1 +

+ The octet %82 does not represent a valid ISO-8859-1 code point, so + the UA should really ignore the parameter. +

attwithfn2231ws1 + [TEST] +

Content-Disposition: attachment; filename *=UTF-8''foo-%c3%a4.html
+ Test Results +
FF3fail + (displays garbage) +
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using RFC2231 encoded UTF-8, with whitespace before "*=" +

+ The parameter is invalid, thus should be ignored. +

attwithfn2231ws2 + [TEST] +

Content-Disposition: attachment; filename*= UTF-8''foo-%c3%a4.html
+ Test Results +
FF3pass
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using RFC2231 encoded UTF-8, with whitespace after "*=" +

+ UA should offer to download the resource as "foo-ä.html". +

attwithfn2231ws3 + [TEST] +

Content-Disposition: attachment; filename* =UTF-8''foo-%c3%a4.html
+ Test Results +
FF3pass
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using RFC2231 encoded UTF-8, with whitespace inside "* =" +

+ UA should offer to download the resource as "foo-ä.html". +

attwithfn2231quot + [TEST] +

Content-Disposition: attachment; filename*="UTF-8''foo-%c3%a4.html"
+ Test Results +
FF3fail + (tries to be helpful by removing the quotes) +
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using RFC2231 encoded UTF-8, with double quotes + around the parameter value. +

+ The parameter is invalid, thus should be ignored. +

attwithfn2231encmissing + [TEST] +

Content-Disposition: attachment; filename*=''foo-%c3%a4.html
+ Test Results +
FF3fail + (sniffs the encoding as UTF-8) +
MSIE8unsupported
Op10fail + (assumes a default of ISO-8859-1) +
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using RFC2231 encoded UTF-8, but + leaving out the charset field. +

+ The parameter is invalid, thus should be ignored. +

RFC2231 Encoding: Continuations

+

+ Various tests using the parameter value continuation efined + in Section 3 of RFC 2231. +

+

attfncont + [TEST] +

Content-Disposition: attachment; filename*0="foo."; filename*1="html"
+ Test Results +
FF3pass
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo.html, using RFC2231-style parameter continuations. +

+ UA should offer to download the resource as "foo.html". +

attfncontenc + [TEST] +

Content-Disposition: attachment; filename*0*=UTF-8''foo-%c3%a4; filename*1=".html"
+ Test Results +
FF3pass
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo-ä.html, using both RFC2231-style parameter continuations + and UTF-8 encoding. +

+ UA should offer to download the resource as "foo-ä.html". +

attfncontlz + [TEST] +

Content-Disposition: attachment; filename*0="foo"; filename*01="bar"
+ Test Results +
FF3warn + (accepts leading zeros) +
MSIE8unsupported
Op10warn + (accepts leading zeros) +
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo (the parameter filename*01 should be ignored because of the leading zero) +

+ UA should offer to download the resource as "foo". +

attfncontnc + [TEST] +

Content-Disposition: attachment; filename*0="foo"; filename*2="bar"
+ Test Results +
FF3warn + (accepts gaps) +
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foo (the parameter filename*2 because there's no filename*1 parameter) +

+ UA should offer to download the resource as "foo". +

attfnconts1 + [TEST] +

Content-Disposition: attachment; filename*1="foo."; filename*2="html"
+ Test Results +
FF3pass
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment' (the filename* parameters should be ignored because filename*0 is missing) +

+ UA should offer to download, not getting the filename from the header. +

attfncontord + [TEST] +

Content-Disposition: attachment; filename*1="bar"; filename*0="foo"
+ Test Results +
FF3fail + (parameters are expected to be ordered) +
MSIE8unsupported
Op10pass
Saf4unsupported
Konqunsupported
Chromeunsupported

+ 'attachment', specifying a filename of foobar +

+ UA should offer to download the resource as "foobar". +

RFC2231 Encoding: Fallback Behaviour

+

+ This tests how the UA behaves when the same parameter name appear + both in traditional and RFC 2231 extended format. +

+

attfnboth + [TEST] +

Content-Disposition: attachment; filename="foo-ae.html"; filename*=UTF-8''foo-%c3%a4.html
+ Test Results +
FF3pass + (picks the traditionally encoded value -- the first of both) +
MSIE8pass + (picks the traditionally encoded value -- the first of both) +
Op10pass + (picks the traditionally encoded value -- the first of both) +
Saf4pass + (picks the traditionally encoded value -- the first of both) +
Konqpass + (picks the traditionally encoded value -- the first of both) +
Chromepass + (picks the traditionally encoded value -- the first of both) +

+ 'attachment', specifying a filename of foo-ae.html in + the traditional format, and foo-ä.html in RFC2231 format. +

+ The behaviour of this undefined. Thus UAs should one of the two values. +

attfnboth2 + [TEST] +

Content-Disposition: attachment; filename*=UTF-8''foo-%c3%a4.html; filename="foo-ae.html"
+ Test Results +
FF3pass + (picks the RFC2231 encoded value -- the first of both) +
MSIE8fail + (ignores the parameter (this indicates a parsing bug)) +
Op10pass + (picks the RFC2231 encoded value -- the first of both) +
Saf4pass + (picks the traditionally encoded value -- the one it understands) +
Konqpass + (picks the traditionally encoded value -- the one it understands) +
Chromefail + (ignores the parameter (this indicates a parsing bug)) +

+ 'attachment', specifying a filename of foo-ae.html in + the traditional format, and foo-ä.html in RFC2231 format. +

+ The behaviour of this undefined. Thus UAs should one of the two values. +

RFC2047 Encoding

+

+ These tests RFC 2047 style encoding. +

+

+ Note that according to Section 5 of RFC 2047, + this encoding does not apply here: An 'encoded-word' MUST NOT appear within a 'quoted-string'., and + An 'encoded-word' MUST NOT be used in parameter of a MIME + Content-Type or Content-Disposition field, or in any structured + field body except within a 'comment' or 'phrase'. +

+

+ Therefore, these tests are only be present in order to check + whether the UA by mistake tries to implement RFC2047. +

+

attrfc2047token + [TEST] +

Content-Disposition: attachment; filename==?ISO-8859-1?Q?foo-=E4.html?=
+ Test Results +
FF3fail + (decodes it anyway to "foo-ä.html") +
MSIE8pass + (takes the whole value as filename, but does not decode it (replacing question marks by underscores)) +
Op10fail + (displays garbage ("=.htm")) +
Saf4pass + (takes the whole value as filename, but does not decode it (replacing question marks by underscores)) +
Konqfail + (decodes it anyway to "foo-ä.html") +
Chromefail + (decodes it anyway to "foo-ä.html") +

+ Uses RFC 2047 style encoded word. "=" is invalid inside the token + production, so this is invalid. +

attrfc2047quoted + [TEST] +

Content-Disposition: attachment; filename="=?ISO-8859-1?Q?foo-=E4.html?="
+ Test Results +
FF3fail + (decodes it anyway to "foo-ä.html") +
MSIE8pass + (takes the whole value as filename, but does not decode it) +
Op10fail + (displays garbage ("=.htm")) +
Saf4pass + (takes the whole value as filename, but does not decode it) +
Konqfail + (decodes it anyway to "foo-ä.html") +
Chromefail + (decodes it anyway to "foo-ä.html") +

+ Uses RFC 2047 style encoded word, using the quoted-string production. +

+ \ No newline at end of file -- cgit v1.2.1 From a708a0e447af81412599ec16e8d47e06dc584eb0 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 20 Apr 2010 16:43:10 +0200 Subject: New (empty) urlbar test and improved protocolhandler test --- src/tests/CMakeLists.txt | 14 ++++++- src/tests/networkaccessmanager_test.cpp | 2 +- src/tests/protocolhandler_test.cpp | 56 +++++++++++++++---------- src/tests/urlbar_test.cpp | 74 +++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 23 deletions(-) create mode 100644 src/tests/urlbar_test.cpp (limited to 'src/tests') diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index e05a056b..3bc9a27f 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -7,7 +7,6 @@ INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../adblock ${CMAKE_CURRENT_SOURCE_DIR}/../bookmarks ${CMAKE_CURRENT_SOURCE_DIR}/../history - ${CMAKE_CURRENT_SOURCE_DIR}/../rekonqpage ${CMAKE_CURRENT_SOURCE_DIR}/../settings ${CMAKE_CURRENT_SOURCE_DIR}/../urlbar ${KDE4_INCLUDES} @@ -68,6 +67,7 @@ target_link_libraries( protocolhandler_test ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KDEWEBKIT_LIBS} + ${QT_QTNETWORK_LIBRARY} ${QT_QTTEST_LIBRARY} ) @@ -153,4 +153,16 @@ target_link_libraries( webview_test ${QT_QTTEST_LIBRARY} ) +##### ------------- urlbar test + +kde4_add_unit_test( urlbar_test urlbar_test.cpp ) + +target_link_libraries( urlbar_test + kdeinit_rekonq + ${KDE4_KDECORE_LIBS} + ${KDE4_KDEUI_LIBS} + ${KDE4_KDEWEBKIT_LIBS} + ${QT_QTTEST_LIBRARY} +) + ############################################################ diff --git a/src/tests/networkaccessmanager_test.cpp b/src/tests/networkaccessmanager_test.cpp index 68ffc108..ac6cf89e 100644 --- a/src/tests/networkaccessmanager_test.cpp +++ b/src/tests/networkaccessmanager_test.cpp @@ -47,7 +47,7 @@ private: void NetworkAccessManagerTest::initTestCase() { - manager = new NetworkAccessManager; + manager = new NetworkAccessManager(this); } diff --git a/src/tests/protocolhandler_test.cpp b/src/tests/protocolhandler_test.cpp index 71d8d9ec..a3c78c2f 100644 --- a/src/tests/protocolhandler_test.cpp +++ b/src/tests/protocolhandler_test.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "protocolhandler.h" @@ -69,45 +70,58 @@ void ProtocolhandlerTest::cleanupTestCase() void ProtocolhandlerTest::preHandling_data() { QTest::addColumn("urlString"); + QTest::addColumn("result"); - 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"; + QTest::newRow("mailto") << "mailto:me@here.com" << true ; + QTest::newRow("relative") << "google.it" << false ; + QTest::newRow("javascript") << "javascript:alertbox('hello')" << true ; + QTest::newRow("aboutblank") << "about:blank" << false ; + QTest::newRow("abouthome") << "about:home" << true ; + QTest::newRow("ftp") << "ftp://ftp.kde.org" << false ; + QTest::newRow("file") << "file:///home" << false ; } 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 ); + QFETCH( QString, urlString ); + QFETCH( bool , result ); + + QWebView *view = new QWebView; + QWebFrame *frame = view->page()->mainFrame(); + + QNetworkRequest request = QNetworkRequest( QUrl(urlString) ); + + QCOMPARE( handler->preHandling( request, frame ) , result ); } void ProtocolhandlerTest::postHandling_data() { QTest::addColumn("urlString"); + QTest::addColumn("result"); - 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"; + QTest::newRow("mailto") << "mailto:me@here.com" << true ; + QTest::newRow("relative") << "google.it" << false ; + QTest::newRow("javascript") << "javascript:alertbox('hello')" << false ; + QTest::newRow("aboutblank") << "about:blank" << false ; + QTest::newRow("abouthome") << "about:home" << false ; + QTest::newRow("ftp") << "ftp://ftp.kde.org" << true ; + QTest::newRow("file") << "file:///home" << true ; } void ProtocolhandlerTest::postHandling() { + QFETCH( QString, urlString ); + QFETCH( bool , result ); + + QWebView *view = new QWebView; + QWebFrame *frame = view->page()->mainFrame(); + + QNetworkRequest request = QNetworkRequest( QUrl(urlString) ); + + QCOMPARE( handler->postHandling( request, frame ) , result ); } // ------------------------------------------- diff --git a/src/tests/urlbar_test.cpp b/src/tests/urlbar_test.cpp new file mode 100644 index 00000000..7a1fb40b --- /dev/null +++ b/src/tests/urlbar_test.cpp @@ -0,0 +1,74 @@ +/* + * Copyright 2010 Andrea Diamantini + * + * 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 + +#include +#include +#include + +#include "webpage.h" +#include "webview.h" +#include "webtab.h" + +#include "urlbar.h" + + +class UrlBarTest : public QObject +{ + Q_OBJECT + +public slots: + void initTestCase(); + void cleanupTestCase(); + +private slots: + +private: + UrlBar *bar; + WebTab *tab; +}; + + +// ------------------------------------------- + +void UrlBarTest::initTestCase() +{ + tab = new WebTab; + bar = new UrlBar(tab); +} + + +void UrlBarTest::cleanupTestCase() +{ + delete bar; + delete tab; +} + + +// ------------------------------------------- + + + +// ------------------------------------------- + +QTEST_KDEMAIN(UrlBarTest,GUI) +#include "urlbar_test.moc" -- cgit v1.2.1