diff --git a/tests/ui/modules/Linphone/Chat/Message.qml b/tests/ui/modules/Linphone/Chat/Message.qml
index cba926b12..00cad5076 100644
--- a/tests/ui/modules/Linphone/Chat/Message.qml
+++ b/tests/ui/modules/Linphone/Chat/Message.qml
@@ -39,12 +39,15 @@ Item {
padding: ChatStyle.entry.message.padding
readOnly: true
selectByMouse: true
- text: Utils.encodeUrisToQmlFormat($content)
+ text: Utils.encodeUrisToQmlFormat($content, {
+ imagesHeight: ChatStyle.entry.message.imagesHeight,
+ imagesWidth: 'auto'
+ })
wrapMode: Text.Wrap
// See http://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop
// and http://doc.qt.io/qt-5/richtext-html-subset.html
- textFormat: Text.RichText
+ textFormat: Text.RichText // To supports links and imgs.
onLinkActivated: Qt.openUrlExternally(link)
diff --git a/tests/ui/modules/Linphone/Styles/ChatStyle.qml b/tests/ui/modules/Linphone/Styles/ChatStyle.qml
index 10b5a3c43..09849d7a4 100644
--- a/tests/ui/modules/Linphone/Styles/ChatStyle.qml
+++ b/tests/ui/modules/Linphone/Styles/ChatStyle.qml
@@ -47,6 +47,7 @@ QtObject {
}
property QtObject message: QtObject {
+ property int imagesHeight: 48
property int padding: 8
property int radius: 4
diff --git a/tests/ui/scripts/Utils/utils.js b/tests/ui/scripts/Utils/utils.js
index 08a4254b2..6c31f5be7 100644
--- a/tests/ui/scripts/Utils/utils.js
+++ b/tests/ui/scripts/Utils/utils.js
@@ -142,9 +142,13 @@ function qmlTypeof (object, className) {
// -------------------------------------------------------------------
-function encodeUrisToQmlFormat (text) {
+function encodeUrisToQmlFormat (text, options) {
var images = ''
+ if (options == null) {
+ options = {}
+ }
+
text = text
.replace(//g, '\u2063>')
@@ -156,8 +160,15 @@ function encodeUrisToQmlFormat (text) {
var ext = getExtension(match)
if (includes([ 'jpg', 'jpeg', 'gif', 'png', 'svg' ], ext)) {
- images += '
'
+ images += '
'
}
return '' + match + ''