| 20 | } |
| 21 | |
| 22 | Shared<snap::valdi_core::Cancelable> MockedAssetLoaderWithDownloader::loadAsset( |
| 23 | const Value& requestPayload, |
| 24 | int32_t preferredWidth, |
| 25 | int32_t preferredHeight, |
| 26 | const Value& filter, |
| 27 | const Ref<AssetLoaderCompletion>& completion) { |
| 28 | return downloader->downloadItem(requestPayload.toStringBox(), [completion](auto result) { |
| 29 | if (result) { |
| 30 | Ref<LoadedAsset> asset = makeShared<StandaloneLoadedAsset>(result.value(), 0, 0); |
| 31 | completion->onLoadComplete(asset); |
| 32 | } else { |
| 33 | completion->onLoadComplete(result.moveError()); |
| 34 | } |
| 35 | }); |
| 36 | } |
| 37 | |
| 38 | MockAssetLoaderFactory::MockAssetLoaderFactory(snap::valdi_core::AssetOutputType outputType) : outputType(outputType) {} |
| 39 |
nothing calls this directly
no test coverage detected