summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-07 21:56:10 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-07 21:56:42 (GMT)
commitb387f6a1627f8685766392521e8df2cf996e8f92 (patch)
tree6031f3f2a38390f615dcfaddef393983acbd0cc1
parentf1cc2c8c75b6bd452027a34c8c92ec61bd6a5a48 (diff)
increase test apps
-rw-r--r--webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp21
-rw-r--r--webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.h2
2 files changed, 22 insertions, 1 deletions
diff --git a/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp b/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp
index 46080d6..4cb8ea7 100644
--- a/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp
+++ b/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.cpp
@@ -46,6 +46,13 @@ CheckPhishingUrlGui::CheckPhishingUrlGui(QWidget *parent)
mResult->setReadOnly(true);
mResult->setAcceptRichText(false);
layout->addWidget(mResult);
+
+ mJson = new QTextEdit(this);
+ mJson->setReadOnly(true);
+ mJson->setAcceptRichText(false);
+ layout->addWidget(mJson);
+
+
}
CheckPhishingUrlGui::~CheckPhishingUrlGui()
@@ -63,10 +70,16 @@ void CheckPhishingUrlGui::slotCheckUrl()
WebEngineViewer::CheckPhishingUrlJob *job = new WebEngineViewer::CheckPhishingUrlJob(this);
connect(job, &WebEngineViewer::CheckPhishingUrlJob::result, this, &CheckPhishingUrlGui::slotGetResult);
- job->setUrl(QUrl(urlStr));
+ connect(job, &WebEngineViewer::CheckPhishingUrlJob::debugJson, this, &CheckPhishingUrlGui::slotJSonDebug);
+ job->setUrl(QUrl::fromUserInput(urlStr));
job->start();
}
+void CheckPhishingUrlGui::slotJSonDebug(const QByteArray &debug)
+{
+ mJson->setText(QString::fromLatin1(debug));
+}
+
void CheckPhishingUrlGui::slotGetResult(WebEngineViewer::CheckPhishingUrlJob::UrlStatus result)
{
QString resultStr;
@@ -80,6 +93,12 @@ void CheckPhishingUrlGui::slotGetResult(WebEngineViewer::CheckPhishingUrlJob::Ur
case WebEngineViewer::CheckPhishingUrlJob::Unknown:
resultStr = QStringLiteral("Url Unknow state");
break;
+ case WebEngineViewer::CheckPhishingUrlJob::BrokenNetwork:
+ resultStr = QStringLiteral("Broken Network");
+ break;
+ case WebEngineViewer::CheckPhishingUrlJob::InvalidUrl:
+ resultStr = QStringLiteral("Invalid Url");
+ break;
}
mResult->setText(resultStr);
}
diff --git a/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.h b/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.h
index 936e6d9..2cedf4c 100644
--- a/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.h
+++ b/webengineviewer/src/checkphishingurl/tests/checkphishingurlgui.h
@@ -34,8 +34,10 @@ public:
private Q_SLOTS:
void slotCheckUrl();
void slotGetResult(WebEngineViewer::CheckPhishingUrlJob::UrlStatus result);
+ void slotJSonDebug(const QByteArray &debug);
private:
QLineEdit *mCheckUrlLineEdit;
+ QTextEdit *mJson;
QTextEdit *mResult;
};