You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
979 B
C#
34 lines
979 B
C#
|
3 years ago
|
using System.Collections;
|
||
|
|
using NUnit.Framework;
|
||
|
|
using Unity.Burst.Editor;
|
||
|
|
using UnityEditor;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.TestTools;
|
||
|
|
|
||
|
|
[TestFixture]
|
||
|
|
public class BurstInspectorGUITests
|
||
|
|
{
|
||
|
|
[UnityTest]
|
||
|
|
[UnityPlatform(RuntimePlatform.WindowsEditor, RuntimePlatform.OSXEditor)]
|
||
|
|
public IEnumerator TestInspectorOpenDuringDomainReloadDoesNotLogErrors()
|
||
|
|
{
|
||
|
|
// Show Inspector window
|
||
|
|
EditorWindow.GetWindow<BurstInspectorGUI>().Show();
|
||
|
|
|
||
|
|
Assert.IsTrue(EditorWindow.HasOpenInstances<BurstInspectorGUI>());
|
||
|
|
|
||
|
|
// Ask for domain reload
|
||
|
|
EditorUtility.RequestScriptReload();
|
||
|
|
|
||
|
|
// Wait for the domain reload to be completed
|
||
|
|
yield return new WaitForDomainReload();
|
||
|
|
|
||
|
|
Assert.IsTrue(EditorWindow.HasOpenInstances<BurstInspectorGUI>());
|
||
|
|
|
||
|
|
// Hide Inspector window
|
||
|
|
EditorWindow.GetWindow<BurstInspectorGUI>().Close();
|
||
|
|
|
||
|
|
Assert.IsFalse(EditorWindow.HasOpenInstances<BurstInspectorGUI>());
|
||
|
|
}
|
||
|
|
}
|