Commit 935a86c1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Improve autotest

parent 464d59d2
Pipeline #21566 passed with stage
in 17 minutes and 38 seconds
...@@ -53,6 +53,9 @@ target_link_libraries(testselectionchangedwebengine ...@@ -53,6 +53,9 @@ target_link_libraries(testselectionchangedwebengine
) )
#### ####
add_definitions(-DPICSRC="${CMAKE_CURRENT_SOURCE_DIR}")
set(testwebengineviewinterceptor_test_SRCS set(testwebengineviewinterceptor_test_SRCS
testwebengineviewinterceptor.cpp testwebengineviewinterceptor.cpp
) )
......
...@@ -43,9 +43,15 @@ void CidUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) ...@@ -43,9 +43,15 @@ void CidUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
{ {
const QUrl urlRequestUrl(info.requestUrl()); const QUrl urlRequestUrl(info.requestUrl());
if (urlRequestUrl.scheme() == QLatin1String("cid")) { if (urlRequestUrl.scheme() == QLatin1String("cid")) {
//QUrl r = QUrl::fromLocalFile(QStringLiteral("/source5/kde/kde5.14/share/icons/oxygen/base/16x16/status/audio-volume-medium.png")); QUrl r;
//const QUrl r = QUrl(QStringLiteral("qrc:repeat.svg")); if (urlRequestUrl.url() == QLatin1String("cid:resource_src")) {
const QUrl r = QUrl(QStringLiteral("qrc:audio-volume-medium.png")); qDebug() << " from resource src";
r = QUrl(QStringLiteral("qrc:audio-volume-medium.png"));
} else if (urlRequestUrl.url() == QLatin1String("cid:local_src")) {
qDebug() << " from local file";
r = QUrl::fromLocalFile(QLatin1String(PICSRC "/audio-volume-medium.png"));
}
qDebug() << "urlRequestUrl " << urlRequestUrl;
qDebug() << " r " << r; qDebug() << " r " << r;
info.redirect(r); info.redirect(r);
} }
...@@ -68,7 +74,9 @@ TestWebEngineViewInterceptor::TestWebEngineViewInterceptor(QWidget *parent) ...@@ -68,7 +74,9 @@ TestWebEngineViewInterceptor::TestWebEngineViewInterceptor(QWidget *parent)
"<head>" "<head>"
"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">" "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"
"</head>" "</head>"
"<body><p>Xcvwxcvwxvccwv xwvc w<img src=\"cid:1506382412@KDE\" />cvbxcvbxcvbcvxbvcxbx</p>" "<body>"
"<p>image from resource file<img src=\"cid:resource_src\" /> end</p>"
"<p>image from local file<img src=\"cid:local_src\" /> end</p>"
"<p>Xcv</p>" "<p>Xcv</p>"
"<p>bxcvbxcvbxcvb</p>" "<p>bxcvbxcvbxcvb</p>"
"<br /></body>" "<br /></body>"
......
Markdown is supported
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