Commit 549224ca authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotest

parent 24d9949b
set(testwebengineviewer_webengine_common_SRCS)
ecm_qt_declare_logging_category(testwebengineviewer_webengine_common_SRCS HEADER webengineviewer_debug.h IDENTIFIER WEBENGINEVIEWER_LOG CATEGORY_NAME org.kde.pim.webengineviewer)
add_definitions( -DCHECKPHISHINGURL_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data" )
ecm_add_test(checkphishingurljobtest.cpp ../checkphishingurljob.cpp ${testwebengineviewer_webengine_common_SRCS}
TEST_NAME checkphishingurljobtest
......@@ -12,3 +13,10 @@ ecm_add_test(checkphishingurlfromlocaldatabasejobtest.cpp ../checkphishingurlfr
NAME_PREFIX "webengineview-checkphishingurl-"
LINK_LIBRARIES Qt5::Test Qt5::WebKitWidgets KF5::WebEngineViewer
)
ecm_add_test(createphishingurldatabasejobtest.cpp ../createphishingurldatabasejob.cpp ${testwebengineviewer_webengine_common_SRCS}
TEST_NAME createphishingurldatabasejobtest
NAME_PREFIX "webengineview-checkphishingurl-"
LINK_LIBRARIES Qt5::Test Qt5::WebKitWidgets KF5::WebEngineViewer
)
......@@ -21,6 +21,7 @@
#include "../checkphishingurlfromlocaldatabasejob.h"
#include <QTest>
CheckPhishingUrlFromLocalDataBaseJobTest::CheckPhishingUrlFromLocalDataBaseJobTest(QObject *parent)
: QObject(parent)
{
......@@ -32,14 +33,5 @@ CheckPhishingUrlFromLocalDataBaseJobTest::~CheckPhishingUrlFromLocalDataBaseJobT
}
void CheckPhishingUrlFromLocalDataBaseJobTest::shouldCreateRequest_data()
{
}
void CheckPhishingUrlFromLocalDataBaseJobTest::shouldCreateRequest()
{
}
QTEST_MAIN(CheckPhishingUrlFromLocalDataBaseJobTest)
......@@ -28,9 +28,6 @@ class CheckPhishingUrlFromLocalDataBaseJobTest : public QObject
public:
explicit CheckPhishingUrlFromLocalDataBaseJobTest(QObject *parent = Q_NULLPTR);
~CheckPhishingUrlFromLocalDataBaseJobTest();
private Q_SLOTS:
void shouldCreateRequest_data();
void shouldCreateRequest();
};
#endif // CHECKPHISHINGURLFROMLOCALDATABASEJOB_H
/*
Copyright (C) 2016 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "createphishingurldatabasejobtest.h"
#include <QTest>
QByteArray readJsonFile(const QString &jsonFile)
{
QFile file(QLatin1String(CHECKPHISHINGURL_DATA_DIR) + QLatin1Char('/') + jsonFile);
file.open(QIODevice::ReadOnly);
Q_ASSERT(file.isOpen());
const QByteArray data = file.readAll();
Q_ASSERT(!data.isEmpty());
return data;
}
CreatePhishingUrlDataBaseJobTest::CreatePhishingUrlDataBaseJobTest(QObject *parent)
: QObject(parent)
{
}
CreatePhishingUrlDataBaseJobTest::~CreatePhishingUrlDataBaseJobTest()
{
}
void CreatePhishingUrlDataBaseJobTest::shouldCreateRequest_data()
{
}
void CreatePhishingUrlDataBaseJobTest::shouldCreateRequest()
{
}
QTEST_MAIN(CreatePhishingUrlDataBaseJobTest)
/*
Copyright (C) 2016 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef CREATEPHISHINGURLDATABASEJOBTEST_H
#define CREATEPHISHINGURLDATABASEJOBTEST_H
#include <QObject>
class CreatePhishingUrlDataBaseJobTest : public QObject
{
Q_OBJECT
public:
explicit CreatePhishingUrlDataBaseJobTest(QObject *parent = Q_NULLPTR);
~CreatePhishingUrlDataBaseJobTest();
private Q_SLOTS:
void shouldCreateRequest_data();
void shouldCreateRequest();
};
#endif // CREATEPHISHINGURLDATABASEJOBTEST_H
Supports Markdown
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