summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-17 06:53:32 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-17 06:53:32 (GMT)
commit2903fd09a4af6633b402d4dfc055a46d812b6237 (patch)
tree2a3984bb669d5760bae4912133abb464e14ec45e
parente85794b78461498cb610fa4914cafbfad3f00b32 (diff)
Add more autotests
-rw-r--r--webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp20
-rw-r--r--webengineviewer/src/checkphishingurl/autotests/data/test2.json32
2 files changed, 52 insertions, 0 deletions
diff --git a/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp b/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp
index 295f11b..db8828d 100644
--- a/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp
+++ b/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp
@@ -141,6 +141,26 @@ void CreatePhishingUrlDataBaseJobTest::shouldParseResult_data()
value.removalList = removalList;
QTest::newRow("test1") << QStringLiteral("test1.json") << WebEngineViewer::CreatePhishingUrlDataBaseJob::ValidData << value;
+
+ value.clear();
+ QVector<WebEngineViewer::Addition> additionList2;
+ tmp.prefixSize = 4;
+ tmp.hashString = QByteArrayLiteral("AAAaxAAAG3QAACdhAAA");
+ additionList2.append(tmp);
+ tmp.prefixSize = 5;
+ tmp.hashString = QByteArrayLiteral("IL5HqwT2c6bltw==");
+ additionList2.append(tmp);
+
+ value.minimumWaitDuration = QStringLiteral("1786.932s");
+ value.threatType = QStringLiteral("MALWARE");
+ value.threatEntryType = QStringLiteral("URL");
+ value.responseType = QStringLiteral("FULL_UPDATE");
+ value.platformType = QStringLiteral("WINDOWS");
+ value.newClientState = QStringLiteral("Cg0IARAGGAEiAzAwMTABELmwARoCGAUmgN3G");
+ value.sha256 = QStringLiteral("ANcYWR8Umuoir+uNs1AhfxqW0iXEPDkxN6Pp2QF8dSs=");
+ value.additionList = additionList2;
+
+ QTest::newRow("test2") << QStringLiteral("test2.json") << WebEngineViewer::CreatePhishingUrlDataBaseJob::ValidData << value;
}
void CreatePhishingUrlDataBaseJobTest::shouldParseResult()
diff --git a/webengineviewer/src/checkphishingurl/autotests/data/test2.json b/webengineviewer/src/checkphishingurl/autotests/data/test2.json
new file mode 100644
index 0000000..02a869e
--- /dev/null
+++ b/webengineviewer/src/checkphishingurl/autotests/data/test2.json
@@ -0,0 +1,32 @@
+{
+ "listUpdateResponses": [
+ {
+ "threatType": "MALWARE",
+ "threatEntryType": "URL",
+ "platformType": "WINDOWS",
+ "responseType": "FULL_UPDATE",
+ "additions": [
+ {
+ "compressionType": "RAW",
+ "rawHashes": {
+ "prefixSize": 4,
+ "rawHashes": "AAAaxAAAG3QAACdhAAA"
+ }
+ },
+ {
+ "compressionType": "RAW",
+ "rawHashes": {
+ "prefixSize": 5,
+ "rawHashes": "IL5HqwT2c6bltw=="
+ }
+ }
+ ],
+ "newClientState": "Cg0IARAGGAEiAzAwMTABELmwARoCGAUmgN3G",
+ "checksum": {
+ "sha256": "ANcYWR8Umuoir+uNs1AhfxqW0iXEPDkxN6Pp2QF8dSs="
+ }
+ }
+ ],
+ "minimumWaitDuration": "1786.932s"
+}
+