Skip to content

Commit

Permalink
Trying fix for failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shaynie committed Jul 25, 2023
1 parent fdb3708 commit 1a49119
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ private void OnDisable()
ReticleSetActive(false);
}

/// <summary>
/// A Unity event function that is called every frame, if this object is enabled.
/// </summary>
private void LateUpdate()
{
// if running in batch mode the onBeforeRender event doesn't fire so
// we need to update the reticle here
if (Application.isBatchMode)
{
UpdateReticle();
}
}

private static readonly ProfilerMarker UpdateReticlePerfMarker = new ProfilerMarker("[MRTK] MRTKRayReticleVisual.UpdateReticle");

[BeforeRenderOrder(XRInteractionUpdateOrder.k_BeforeRenderLineVisual)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,15 @@ public IEnumerator TestNoHandlesToggleWhenMovingWithObjectManipulator([ValueSour
[UnityTest]
public IEnumerator TestManipulationCursor([ValueSource(nameof(BoundsVisualsPrefabs))] string visualsPath)
{
// TODO: re-enable tests after debugging failures during build
// Known left scale handle
// yield return HoverCursorRotation("ScaleHandle", new Vector3(0f, 180f, 45f), visualsPath);
yield return HoverCursorRotation("ScaleHandle", new Vector3(0f, 180f, 45f), visualsPath);
// Known right scale handle
// yield return HoverCursorRotation("ScaleHandle (1)", new Vector3(0f, 180f, 315f), visualsPath);
yield return HoverCursorRotation("ScaleHandle (1)", new Vector3(0f, 180f, 315f), visualsPath);
// Known bottom rotate handle
// yield return HoverCursorRotation("RotateHandle (5)", new Vector3(0f, 180f, 90f), visualsPath);
yield return HoverCursorRotation("RotateHandle (5)", new Vector3(0f, 180f, 90f), visualsPath);
// Known side rotate handle
// yield return HoverCursorRotation("RotateHandle (10)", new Vector3(0f, 180f, 0f), visualsPath);
yield return null;
yield return HoverCursorRotation("RotateHandle (10)", new Vector3(0f, 180f, 0f), visualsPath);

}

private bool ApproximatelyEquals(Vector3 a, Vector3 b, float tolerance = 0.1f)
Expand Down

0 comments on commit 1a49119

Please sign in to comment.