Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/room/autotests/messagelistdelegatetest.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 132 | } else { | |||
---|---|---|---|---|---|
137 | if (!message.attachements().isEmpty()) { | 137 | if (!message.attachements().isEmpty()) { | ||
138 | QCOMPARE(layout.attachmentsRect.top(), layout.textRect.y() + layout.textRect.height()); | 138 | QCOMPARE(layout.attachmentsRect.top(), layout.textRect.y() + layout.textRect.height()); | ||
139 | } | 139 | } | ||
140 | } | 140 | } | ||
141 | 141 | | |||
142 | const int bottom = layout.usableRect.y() + layout.usableRect.height(); | 142 | const int bottom = layout.usableRect.y() + layout.usableRect.height(); | ||
143 | 143 | | |||
144 | // Avatar | 144 | // Avatar | ||
145 | QCOMPARE(layout.avatarPixmap.height(), layout.senderRect.height()); | 145 | QCOMPARE(layout.avatarPixmap.height() / layout.avatarPixmap.devicePixelRatioF(), layout.senderRect.height()); | ||
146 | QCOMPARE(layout.avatarPixmap.devicePixelRatioF(), fakeWidget.devicePixelRatioF()); | ||||
146 | //qDebug() << layout.avatarPos.y() << "+" << layout.avatarPixmap.height() << "must be <=" << bottom; | 147 | //qDebug() << layout.avatarPos.y() << "+" << layout.avatarPixmap.height() << "must be <=" << bottom; | ||
147 | QVERIFY(layout.avatarPos.y() + layout.avatarPixmap.height() <= bottom); | 148 | QVERIFY(layout.avatarPos.y() + layout.avatarPixmap.height() / layout.avatarPixmap.devicePixelRatioF() <= bottom); | ||
148 | 149 | | |||
149 | // Reactions | 150 | // Reactions | ||
150 | if (message.reactions().isEmpty()) { | 151 | if (message.reactions().isEmpty()) { | ||
151 | QCOMPARE(layout.reactionsHeight, 0); | 152 | QCOMPARE(layout.reactionsHeight, 0); | ||
152 | } else { | 153 | } else { | ||
153 | QVERIFY(layout.reactionsHeight > 15); | 154 | QVERIFY(layout.reactionsHeight > 15); | ||
154 | QVERIFY(layout.reactionsY + layout.reactionsHeight <= bottom); | 155 | QVERIFY(layout.reactionsY + layout.reactionsHeight <= bottom); | ||
155 | } | 156 | } | ||
156 | 157 | | |||
157 | // Edited | 158 | // Edited | ||
158 | if (message.wasEdited()) { | 159 | if (message.wasEdited()) { | ||
159 | QVERIFY(option.rect.contains(layout.editedIconRect)); | 160 | QVERIFY(option.rect.contains(layout.editedIconRect)); | ||
160 | QVERIFY(!layout.editedIconRect.intersects(layout.textRect)); | 161 | QVERIFY(!layout.editedIconRect.intersects(layout.textRect)); | ||
161 | QVERIFY(!layout.editedIconRect.intersects(layout.senderRect.toRect())); | 162 | QVERIFY(!layout.editedIconRect.intersects(layout.senderRect.toRect())); | ||
162 | } | 163 | } | ||
163 | } | 164 | } |