From 11207a4554645ac89828dc593394230db952093c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 10 Sep 2020 22:47:00 -0700 Subject: [PATCH] Remove tests that require edit mode support with #ifdef in 2020.x --- Runtime/Scripts/Core/VRView.cs | 4 ++-- Tests/Editor/Unit/Core/EditingContextManagerTests.cs | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Runtime/Scripts/Core/VRView.cs b/Runtime/Scripts/Core/VRView.cs index 9fcfd17ad..1ab538245 100644 --- a/Runtime/Scripts/Core/VRView.cs +++ b/Runtime/Scripts/Core/VRView.cs @@ -552,5 +552,5 @@ void SetAutoRepaintOnSceneChanged(Type viewType, bool enabled) } } #endif - } - } + } +} diff --git a/Tests/Editor/Unit/Core/EditingContextManagerTests.cs b/Tests/Editor/Unit/Core/EditingContextManagerTests.cs index 30849fec4..d888cf292 100644 --- a/Tests/Editor/Unit/Core/EditingContextManagerTests.cs +++ b/Tests/Editor/Unit/Core/EditingContextManagerTests.cs @@ -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; @@ -47,6 +52,7 @@ public void Setup() EditingContextManager.SaveProjectSettings(settings); } +#if UNITY_EDITORXR_EDIT_MODE_SUPPORT [Test] public void Initializes_WithDefaultContext() { @@ -87,6 +93,7 @@ public void RestorePreviousContext_SetsPreviousContextToCurrent() manager.RestorePreviousContext(); Assert.AreEqual(beginningContext, manager.currentContext); } +#endif [Test] public void LoadProjectSettings_IfAssetFound() @@ -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 } }