Skip to content

Commit 11207a4

Browse files
Remove tests that require edit mode support with #ifdef in 2020.x
1 parent cb8f8f1 commit 11207a4

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Runtime/Scripts/Core/VRView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,5 +552,5 @@ void SetAutoRepaintOnSceneChanged(Type viewType, bool enabled)
552552
}
553553
}
554554
#endif
555-
}
556-
}
555+
}
556+
}

Tests/Editor/Unit/Core/EditingContextManagerTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Edit mode support requires legacy VR, which was removed in 2020.1
2+
#if UNITY_EDITOR && !UNITY_2020_1_OR_NEWER
3+
#define UNITY_EDITORXR_EDIT_MODE_SUPPORT
4+
#endif
5+
16
using NUnit.Framework;
27
using System.Collections.Generic;
38
using System.IO;
@@ -47,6 +52,7 @@ public void Setup()
4752
EditingContextManager.SaveProjectSettings(settings);
4853
}
4954

55+
#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
5056
[Test]
5157
public void Initializes_WithDefaultContext()
5258
{
@@ -87,6 +93,7 @@ public void RestorePreviousContext_SetsPreviousContextToCurrent()
8793
manager.RestorePreviousContext();
8894
Assert.AreEqual(beginningContext, manager.currentContext);
8995
}
96+
#endif
9097

9198
[Test]
9299
public void LoadProjectSettings_IfAssetFound()
@@ -163,10 +170,15 @@ public void SaveUserSettings_UpdatesUserSettingsFile()
163170
[OneTimeTearDown]
164171
public void Cleanup()
165172
{
173+
#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
166174
manager.SetEditingContext(EditingContextManager.defaultContext);
175+
#endif
167176
UnityObjectUtils.Destroy(context);
168177
UnityObjectUtils.Destroy(context2);
178+
179+
#if UNITY_EDITORXR_EDIT_MODE_SUPPORT
169180
VRView.activeView.Close();
181+
#endif
170182
}
171183
}
172184

0 commit comments

Comments
 (0)