QmlDesigner: Don't save null image for preview collector

Change-Id: I01ad1c12c25a734107b359461508c037a2f23bb2
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marco Bubke
2022-01-10 15:46:19 +01:00
parent 0c00f58e8b
commit 3d0d9e8e0c
5 changed files with 27 additions and 50 deletions

View File

@@ -113,12 +113,10 @@ TEST_F(AsynchronousImageFactory, RequestImageWithAuxiliaryDataRequestImageFromGe
TEST_F(AsynchronousImageFactory, DontRequestImageRequestImageFromGeneratorIfFileWasNotUpdated)
{
ON_CALL(mockStorage, fetchHasImage(Eq("/path/to/Component.qml"))).WillByDefault([&](auto) {
ON_CALL(mockStorage, fetchModifiedImageTime(Eq("/path/to/Component.qml"))).WillByDefault([&](auto) {
notification.notify();
return true;
return Sqlite::TimeStamp{124};
});
ON_CALL(mockStorage, fetchModifiedImageTime(Eq("/path/to/Component.qml")))
.WillByDefault(Return(Sqlite::TimeStamp{124}));
ON_CALL(mockTimeStampProvider, timeStamp(Eq("/path/to/Component.qml")))
.WillByDefault(Return(Sqlite::TimeStamp{124}));
@@ -128,28 +126,6 @@ TEST_F(AsynchronousImageFactory, DontRequestImageRequestImageFromGeneratorIfFile
notification.wait();
}
TEST_F(AsynchronousImageFactory,
RequestImageRequestImageFromGeneratorIfFileWasNotUpdatedButTheImageIsNull)
{
ON_CALL(mockStorage, fetchHasImage(Eq("/path/to/Component.qml"))).WillByDefault(Return(false));
ON_CALL(mockStorage, fetchModifiedImageTime(Eq("/path/to/Component.qml")))
.WillByDefault(Return(Sqlite::TimeStamp{124}));
ON_CALL(mockTimeStampProvider, timeStamp(Eq("/path/to/Component.qml")))
.WillByDefault(Return(Sqlite::TimeStamp{124}));
EXPECT_CALL(mockGenerator,
generateImage(Eq("/path/to/Component.qml"),
IsEmpty(),
Eq(Sqlite::TimeStamp{124}),
_,
_,
VariantWith<Utils::monostate>(Utils::monostate{})))
.WillRepeatedly([&](auto, auto, auto, auto, auto, auto) { notification.notify(); });
factory.generate("/path/to/Component.qml");
notification.wait();
}
TEST_F(AsynchronousImageFactory, CleanRemovesEntries)
{
EXPECT_CALL(mockGenerator, generateImage(Eq("/path/to/Component1.qml"), _, _, _, _, _))