PlayModeTests: MRTK does not get destroyed when unloading / loading a new scene
Overview
For playmode tests we need to be able to unload a scene, unload MRTK, and then load a new MRTK in a fresh / unmodified state. Currently after unloading a scene and then loading a new scene, MRTK does not reset its state.
This is blocking many play mode test behaviors which rely on MRTK scene being in a consistent state when the test starts. For example, since the MRTK object persists between tests, the currently focused object will not get cleared between tests. This means that we cannot ensure that a focus enter event will get sent in a brand new test when it is put in front of the camera, because MRTK might already be focusing some other (now destroyed) object.
To reproduce, import the unity package in this zip file into your MRTK branch.
Then run the new "TestSceneLoadUnload" test in PlayModeTests.
Expected Behavior
TestSceneLoadUnload test passes because in Test02 we ensure that 1) the previous scene unloads, 2) the new scene loads WITHOUT adding mrtk, and therefore that 3) MRTK is not already initialized.
Actual Behavior
TestSceneLoadUnload test fails because after step 2) above, MRTK is already initialized (even though we have not yet added MRTK to the scene).
This is blocking many play mode test behaviors which rely on MRTK scene being in a consistent state when the test starts. For example, since the MRTK object persists between tests, the currently focused object will not get cleared between tests. This means that we cannot ensure that a focus enter event will get sent in a brand new test when it is put in front of the camera, because MRTK might already be focusing some other (now destroyed) object.
@julenka I believe this can be closed?
Yup, was fixed a while back with Lars's changes to Scene System.