summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-27 05:36:41 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-27 05:36:41 (GMT)
commitb9b37534c27266092b92e220b33bcaab9d068c89 (patch)
treec7107c976c6cb329ee7b39add0dc33cbc4355ed0
parentc139cf8fdc3d51bfc706fbaa9d5a65ab0d73f419 (diff)
Add test application
-rw-r--r--messageviewer/src/CMakeLists.txt1
-rw-r--r--messageviewer/src/checkphishingurl/tests/CMakeLists.txt15
-rw-r--r--messageviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp62
-rw-r--r--messageviewer/src/checkphishingurl/tests/checkphishingurlgui.h38
4 files changed, 116 insertions, 0 deletions
diff --git a/messageviewer/src/CMakeLists.txt b/messageviewer/src/CMakeLists.txt
index f21d141..e6d1521 100644
--- a/messageviewer/src/CMakeLists.txt
+++ b/messageviewer/src/CMakeLists.txt
@@ -37,6 +37,7 @@ if(BUILD_TESTING)
add_subdirectory(messagepartthemes/default/autotests)
add_subdirectory(viewer/webengine/autotests/)
add_subdirectory(checkphishingurl/autotests/)
+ add_subdirectory(checkphishingurl/tests/)
endif()
add_subdirectory(pics)
add_subdirectory(kconf_update)
diff --git a/messageviewer/src/checkphishingurl/tests/CMakeLists.txt b/messageviewer/src/checkphishingurl/tests/CMakeLists.txt
new file mode 100644
index 0000000..abbb4be
--- /dev/null
+++ b/messageviewer/src/checkphishingurl/tests/CMakeLists.txt
@@ -0,0 +1,15 @@
+set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
+
+include(ECMAddTests)
+
+include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
+
+set(checkphishingurlgui_SRCS checkphishingurlgui.cpp)
+add_executable(checkphishingurlgui ${checkphishingurlgui_SRCS})
+target_link_libraries(checkphishingurlgui
+ KF5::KIOCore
+ KF5::MessageViewer
+ Qt5::WebEngine
+ Qt5::WebEngineWidgets
+ KF5::I18n
+ )
diff --git a/messageviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp b/messageviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp
new file mode 100644
index 0000000..829df53
--- /dev/null
+++ b/messageviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp
@@ -0,0 +1,62 @@
+/*
+ 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 "checkphishingurlgui.h"
+
+#include <QApplication>
+#include <QStandardPaths>
+#include <QLineEdit>
+#include <QTextEdit>
+#include <QLabel>
+#include <QVBoxLayout>
+
+CheckPhishingUrlGui::CheckPhishingUrlGui(QWidget *parent)
+ : QWidget(parent)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this);
+
+ QHBoxLayout *checkUrlLayout = new QHBoxLayout;
+ layout->addLayout(checkUrlLayout);
+ QLabel *lab = new QLabel(QStringLiteral("Url to Check:"), this);
+ checkUrlLayout->addWidget(lab);
+ mCheckUrlLineEdit = new QLineEdit(this);
+ checkUrlLayout->addWidget(mCheckUrlLineEdit);
+
+ mResult = new QTextEdit(this);
+ mResult->setReadOnly(true);
+ mResult->setAcceptRichText(false);
+ layout->addWidget(mResult);
+}
+
+CheckPhishingUrlGui::~CheckPhishingUrlGui()
+{
+
+}
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+ QStandardPaths::setTestModeEnabled(true);
+ CheckPhishingUrlGui *w = new CheckPhishingUrlGui;
+
+ w->show();
+ app.exec();
+ delete w;
+ return 0;
+}
diff --git a/messageviewer/src/checkphishingurl/tests/checkphishingurlgui.h b/messageviewer/src/checkphishingurl/tests/checkphishingurlgui.h
new file mode 100644
index 0000000..fce0090
--- /dev/null
+++ b/messageviewer/src/checkphishingurl/tests/checkphishingurlgui.h
@@ -0,0 +1,38 @@
+/*
+ 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 CHECKPHISHINGURLGUI_H
+#define CHECKPHISHINGURLGUI_H
+
+#include <QWidget>
+class QLineEdit;
+class QTextEdit;
+class CheckPhishingUrlGui : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit CheckPhishingUrlGui(QWidget *parent = Q_NULLPTR);
+ ~CheckPhishingUrlGui();
+private:
+ QLineEdit *mCheckUrlLineEdit;
+ QTextEdit *mResult;
+};
+
+#endif // CHECKPHISHINGURLGUI_H