Commit bea14bc3 authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotest

parent 8b8a580d
......@@ -7,6 +7,11 @@ ecm_add_test(adblockmanagertest.cpp ${messageviewer_adblock_test_common_SRCS}
LINK_LIBRARIES Qt5::Test Qt5::Widgets adblocklibprivate KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::KIOWidgets KF5::I18n KF5::WebEngineViewer
)
ecm_add_test(adblockinterceptorinterfacetest.cpp ${messageviewer_adblock_test_common_SRCS} ../adblockinterceptorinterface.cpp
TEST_NAME adblockinterceptorinterface
NAME_PREFIX "messageviewer-urlinterceptor-"
LINK_LIBRARIES Qt5::Test Qt5::Widgets adblocklibprivate KF5::ItemViews Qt5::WebEngine Qt5::WebEngineWidgets KF5::KIOWidgets KF5::I18n KF5::WebEngineViewer KF5::XmlGui
)
set( adblockpluginurlinterceptortest_SRCS ${messageviewer_adblock_test_common_SRCS} adblockpluginurlinterceptortest.cpp ../adblockpluginurlinterceptor.cpp ../adblockinterceptorinterface.cpp )
add_executable( adblockpluginurlinterceptortest ${adblockpluginurlinterceptortest_SRCS})
......
/*
Copyright (C) 2016 Montel Laurent <montel@kde.org>
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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "adblockinterceptorinterfacetest.h"
#include <QTest>
AdblockInterceptorInterfaceTest::AdblockInterceptorInterfaceTest(QObject *parent)
: QObject(parent)
{
}
AdblockInterceptorInterfaceTest::~AdblockInterceptorInterfaceTest()
{
}
QTEST_MAIN(AdblockInterceptorInterfaceTest)
/*
Copyright (C) 2016 Montel Laurent <montel@kde.org>
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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef ADBLOCKINTERCEPTORINTERFACETEST_H
#define ADBLOCKINTERCEPTORINTERFACETEST_H
#include <QObject>
class AdblockInterceptorInterfaceTest : public QObject
{
Q_OBJECT
public:
explicit AdblockInterceptorInterfaceTest(QObject *parent = Q_NULLPTR);
~AdblockInterceptorInterfaceTest();
};
#endif // ADBLOCKINTERCEPTORINTERFACETEST_H
......@@ -20,11 +20,12 @@
#include "adblockmanagertest.h"
#include "../lib/adblockmanager.h"
#include <QTest>
#include <QStandardPaths>
AdblockManagerTest::AdblockManagerTest(QObject *parent)
: QObject(parent)
{
QStandardPaths::setTestModeEnabled(true);
}
AdblockManagerTest::~AdblockManagerTest()
......
......@@ -39,5 +39,8 @@ void AdblockPluginUrlInterceptorTest::shouldHaveDefaultValue()
QVERIFY(w.createInterface(new QWebEngineView(), this));
QVERIFY(w.hasConfigureSupport());
WebEngineViewer::NetworkPluginUrlInterceptorConfigureWidgetSetting settings = w.createConfigureWidget(new QWidget());
QVERIFY(settings.configureWidget);
QVERIFY(!settings.name.isEmpty());
}
QTEST_MAIN(AdblockPluginUrlInterceptorTest)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment