QmlDesigner: Add AsynchronousImageFactory

Task-number: QDS-5861
Change-Id: I3d938b3ddaa965da2105a326ea68f498dbb60fa0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2021-12-28 11:32:47 +01:00
parent d479047275
commit 24087bd8b6
17 changed files with 483 additions and 34 deletions

View File

@@ -115,7 +115,7 @@ TEST_F(AsynchronousImageCache, RequestImageRequestImageFromGenerator)
EXPECT_CALL(mockGenerator,
generateImage(Eq("/path/to/Component.qml"), _, Eq(Sqlite::TimeStamp{123}), _, _, _))
.WillRepeatedly([&](auto, auto, auto, auto &&callback, auto, auto) { notification.notify(); });
.WillRepeatedly([&](auto, auto, auto, auto, auto, auto) { notification.notify(); });
cache.requestImage("/path/to/Component.qml",
mockCaptureCallback.AsStdFunction(),
@@ -221,7 +221,7 @@ TEST_F(AsynchronousImageCache, RequestSmallImageRequestImageFromGenerator)
EXPECT_CALL(mockGenerator,
generateImage(Eq("/path/to/Component.qml"), _, Eq(Sqlite::TimeStamp{123}), _, _, _))
.WillRepeatedly([&](auto, auto, auto, auto &&callback, auto, auto) { notification.notify(); });
.WillRepeatedly([&](auto, auto, auto, auto, auto, auto) { notification.notify(); });
cache.requestSmallImage("/path/to/Component.qml",
mockCaptureCallback.AsStdFunction(),
@@ -284,9 +284,7 @@ TEST_F(AsynchronousImageCache, CleanRemovesEntries)
TEST_F(AsynchronousImageCache, CleanCallsAbort)
{
ON_CALL(mockGenerator, generateImage(_, _, _, _, _, _))
.WillByDefault([&](auto, auto, auto, auto &&mockCaptureCallback, auto &&, auto) {
waitInThread.wait();
});
.WillByDefault([&](auto, auto, auto, auto, auto &&, auto) { waitInThread.wait(); });
cache.requestSmallImage("/path/to/Component1.qml",
mockCaptureCallback.AsStdFunction(),
mockAbortCallback.AsStdFunction());