Skip to content

Commit

Permalink
Remove tests that require edit mode support with #ifdef in 2020.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mtschoen-unity committed Sep 11, 2020
1 parent cb8f8f1 commit 11207a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Runtime/Scripts/Core/VRView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -552,5 +552,5 @@ void SetAutoRepaintOnSceneChanged(Type viewType, bool enabled)
}
}
#endif
}
}
}
}
12 changes: 12 additions & 0 deletions Tests/Editor/Unit/Core/EditingContextManagerTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Edit mode support requires legacy VR, which was removed in 2020.1
#if UNITY_EDITOR && !UNITY_2020_1_OR_NEWER
#define UNITY_EDITORXR_EDIT_MODE_SUPPORT
#endif

using NUnit.Framework;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -47,6 +52,7 @@ public void Setup()
EditingContextManager.SaveProjectSettings(settings);
}

#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
[Test]
public void Initializes_WithDefaultContext()
{
Expand Down Expand Up @@ -87,6 +93,7 @@ public void RestorePreviousContext_SetsPreviousContextToCurrent()
manager.RestorePreviousContext();
Assert.AreEqual(beginningContext, manager.currentContext);
}
#endif

[Test]
public void LoadProjectSettings_IfAssetFound()
Expand Down Expand Up @@ -163,10 +170,15 @@ public void SaveUserSettings_UpdatesUserSettingsFile()
[OneTimeTearDown]
public void Cleanup()
{
#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
manager.SetEditingContext(EditingContextManager.defaultContext);
#endif
UnityObjectUtils.Destroy(context);
UnityObjectUtils.Destroy(context2);

#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
VRView.activeView.Close();
#endif
}
}

Expand Down

0 comments on commit 11207a4

Please sign in to comment.