Singularity/Library/PackageCache/com.unity.test-framework@1..../UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs

22 lines
637 B
C#
Raw Normal View History

2024-05-06 14:45:45 -04:00
using System;
using System.Collections;
using UnityEditor.SceneManagement;
namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
{
internal class SaveModiedSceneTask : TestTaskBase
{
internal Func<bool> SaveCurrentModifiedScenesIfUserWantsTo =
EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo;
public override IEnumerator Execute(TestJobData testJobData)
{
var cancelled = !SaveCurrentModifiedScenesIfUserWantsTo();
if (cancelled)
{
throw new TestRunCanceledException();
}
yield break;
}
}
}