Skip to content

Commit 72fc2f0

Browse files
authored
test: run UpdateRenderCachePNGInStreamingAssets() test in Windows and Mac only (#460)
* ignore tests on Linux (failing)
1 parent d6eee4a commit 72fc2f0

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

Tests/Editor/Scripts/RenderCachePlayableAssetTest.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using NUnit.Framework;
44
using Unity.EditorCoroutines.Editor;
55
using Unity.FilmInternalUtilities;
6+
using Unity.FilmInternalUtilities.Editor;
67
using UnityEngine;
78
using UnityEngine.Playables;
89
using Unity.StreamingImageSequence.Editor;
@@ -32,6 +33,7 @@ public IEnumerator CreatePlayableAsset() {
3233

3334
//----------------------------------------------------------------------------------------------------------------------
3435
[UnityTest]
36+
[UnityPlatform(RuntimePlatform.OSXEditor, RuntimePlatform.WindowsEditor)]
3537
public IEnumerator UpdateRenderCachePNGInStreamingAssets() {
3638
PlayableDirector director = EditorUtilityTest.NewSceneWithDirector();
3739
TimelineClip clip = EditorUtilityTest.CreateTestRenderCacheTimelineClip(director);
@@ -58,25 +60,21 @@ public IEnumerator UpdateRenderCachePNGInStreamingAssets() {
5860
//Update RenderCache
5961
EditorCoroutineUtility.StartCoroutineOwnerless(
6062
RenderCachePlayableAssetInspector.UpdateRenderCacheCoroutine(director, renderCachePlayableAsset)
61-
);
63+
);
64+
65+
Assert.IsTrue(Directory.Exists(OUTPUT_FOLDER));
6266

6367
//A hack to wait until the coroutine is finished
64-
const float TIMEOUT_SEC = 3.0f;
65-
Assert.IsTrue(Directory.Exists(OUTPUT_FOLDER));
66-
float prevTime = Time.realtimeSinceStartup;
67-
while (Time.realtimeSinceStartup - prevTime < TIMEOUT_SEC) {
68-
yield return null;
69-
}
68+
const int TIMEOUT_FRAMES = 60 * 3;
69+
yield return YieldEditorUtility.WaitForFramesAndIncrementUndo(TIMEOUT_FRAMES);
70+
7071

7172
string imageFilePath = renderCachePlayableAsset.GetImageFilePath(0);
7273
Assert.IsTrue(File.Exists(imageFilePath));
7374
ImageLoader.RequestLoadFullImage(imageFilePath);
7475

7576
//Another hack to wait until the load is finished
76-
prevTime = Time.realtimeSinceStartup;
77-
while (Time.realtimeSinceStartup - prevTime < TIMEOUT_SEC) {
78-
yield return null;
79-
}
77+
yield return YieldEditorUtility.WaitForFramesAndIncrementUndo(TIMEOUT_FRAMES);
8078

8179
ImageLoader.GetImageDataInto(imageFilePath,StreamingImageSequenceConstants.IMAGE_TYPE_FULL,out ImageData imageData);
8280
Assert.AreEqual(StreamingImageSequenceConstants.READ_STATUS_SUCCESS, imageData.ReadStatus);

0 commit comments

Comments
 (0)