File indexing completed on 2025-03-09 04:54:37

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QObject>
0010 #include <QWidget>
0011 
0012 namespace MessageViewer
0013 {
0014 class ScamDetectionWebEngine;
0015 }
0016 class QWebEngineView;
0017 class TestWebEngineScamDetection : public QWidget
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit TestWebEngineScamDetection(QWidget *parent = nullptr);
0022     ~TestWebEngineScamDetection() override;
0023 
0024     void setHtml(const QString &html);
0025 private Q_SLOTS:
0026     void loadFinished(bool b);
0027 Q_SIGNALS:
0028     void resultScanDetection(bool result);
0029 
0030 private:
0031     QWebEngineView *const mEngineView;
0032     MessageViewer::ScamDetectionWebEngine *const mScamDetectionWebEngine;
0033 };
0034 
0035 class ScamDetectionWebEngineTest : public QObject
0036 {
0037     Q_OBJECT
0038 public:
0039     explicit ScamDetectionWebEngineTest(QObject *parent = nullptr);
0040     ~ScamDetectionWebEngineTest() override;
0041 private Q_SLOTS:
0042     void scamtest_data();
0043     void scamtest();
0044 };