SceneHookTests.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using NUnit.Framework;
  2. using UnityEditor.Recorder;
  3. namespace UnityEngine.Recorder.Tests
  4. {
  5. class SceneHookTests
  6. {
  7. [Test]
  8. public void SceneHookGameObject_AfterStartRecording_ShouldBeVisible()
  9. {
  10. var settings = ScriptableObject.CreateInstance<RecorderControllerSettings>();
  11. var recorder = ScriptableObject.CreateInstance<ImageRecorderSettings>();
  12. settings.AddRecorderSettings(recorder);
  13. var recorderController = new RecorderController(settings);
  14. RecorderOptions.VerboseMode = false; // Make sure visibility is not toggled on because of debugMode.
  15. recorderController.PrepareRecording();
  16. Assert.IsTrue(recorderController.StartRecording());
  17. Assert.IsTrue(recorderController.IsRecording());
  18. var gameObject = GameObject.Find("Unity-RecorderSessions");
  19. Assert.IsNotNull(gameObject);
  20. Assert.IsTrue(gameObject.hideFlags == HideFlags.None);
  21. recorderController.StopRecording();
  22. Object.DestroyImmediate(recorder);
  23. Object.DestroyImmediate(settings);
  24. }
  25. }
  26. }