< Summary

Class:DCL.Providers.EmbeddedAssetBundleProvider
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/AssetBundles/AB/Providers/EmbeddedAssetBundleProvider.cs
Covered lines:0
Uncovered lines:5
Coverable lines:5
Total lines:28
Line coverage:0% (0 of 5)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetAssetBundleAsync()0%42600%
GetUrl(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/AssetBundles/AB/Providers/EmbeddedAssetBundleProvider.cs

#LineLine coverage
 1using Cysharp.Threading.Tasks;
 2using MainScripts.DCL.AssetsEmbedment.Runtime;
 3using System.Threading;
 4using UnityEngine;
 5
 6namespace DCL.Providers
 7{
 8    public class EmbeddedAssetBundleProvider : AssetBundleWebRequestBasedProvider, IAssetBundleProvider
 9    {
 10        private Service<IWebRequestController> webRequestController;
 11
 12        public async UniTask<AssetBundle> GetAssetBundleAsync(string contentUrl, string hash, CancellationToken cancella
 13        {
 014            var streamingPath = GetUrl(hash);
 15            // For WebGL the only way to load assets from `StreamingFolder` is via `WebRequest`
 016            using var webRequest = webRequestController.Ref.GetAssetBundle(streamingPath, requestAttemps: 1, disposeOnCo
 017            return await FromWebRequestAsync(webRequest, streamingPath, cancellationToken);
 018        }
 19
 20        private static string GetUrl(string hash)
 21        {
 22#if UNITY_EDITOR || UNITY_STANDALONE
 023            return $"file://{Application.streamingAssetsPath}/{EmbeddedWearablesPath.VALUE}/{hash}";
 24#endif
 25            return $"{Application.streamingAssetsPath}/{EmbeddedWearablesPath.VALUE}/{hash}";
 26        }
 27    }
 28}