Skip to content

Commit f9f9962

Browse files
giorgospetkakisEvergreen
authored andcommitted
Introduce EditorWindowCapture class for Editor UI image comparison tests
Significantly improves the API in the Graphics Test Framework package and the Internal Editor API for capturing arbitrary Editor Windows. - Adds new API to the Internal Editor Utility class to take snapshots of arbitrary windows instead of just SceneView windows - Makes the older SceneView API obsolete - Adds new API to the Graphics Test Framework to write the snapshot to a Texture2D for full compatibility with the current testing paradigm - Refactors functionality for using this API on a SceneView window, leaving space for any other "special steps" done inside or outside the framework. - Significantly improves the API usability and testability by moving away from IEnumerator setup and to an async setup instead. - Updates the documentation around this functionality. ### Example captures #### Scene view with no modifications ![SceneViewWindow_ImageIsNotNullOrEmpty](https://media.github.cds.internal.unity3d.com/user/2181/files/a5d944b3-021a-481e-b720-3708bae71e5a) #### Scene view with all overlays disabled ![SceneViewWindow_ImageIsNotNullOrEmpty](https://media.github.cds.internal.unity3d.com/user/2181/files/7c79a8aa-10c9-4a5b-b281-491d0a3725be) #### Scene view with most disabled + Debug Draw Mode ![SceneViewWindow_WithDebugDrawMode_ImageMatchesReference_BakedDirectionality_](https://media.github.cds.internal.unity3d.com/user/2181/files/27f23a76-ae59-4186-8257-898db5c34fa2) #### Custom editor window ![CustomEditorWindowCaptureTest](https://media.github.cds.internal.unity3d.com/user/2181/files/067d9764-35ee-4d2d-a8ab-29637722db7d)
1 parent 81a1ed4 commit f9f9962

File tree

15 files changed

+3
-18
lines changed

15 files changed

+3
-18
lines changed

Tests/SRPTests/Projects/BatchRendererGroup_HDRP/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"com.unity.modules.xr": "1.0.0"
5757
},
5858
"testables": [
59-
"com.unity.testframework.graphics",
6059
"com.unity.testing.xr"
6160
],
6261
"useSatSolver": true,

Tests/SRPTests/Projects/BatchRendererGroup_URP/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"com.unity.modules.xr": "1.0.0"
5757
},
5858
"testables": [
59-
"com.unity.testframework.graphics",
6059
"com.unity.testing.xr"
6160
],
6261
"useSatSolver": true,

Tests/SRPTests/Projects/BuiltInGraphicsTest_Foundation/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"com.unity.modules.xr": "1.0.0"
5151
},
5252
"testables": [
53-
"com.unity.testframework.graphics",
5453
"com.unity.testing.xr"
5554
]
5655
}

Tests/SRPTests/Projects/BuiltInGraphicsTest_Lighting/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"com.unity.modules.xr": "1.0.0"
5151
},
5252
"testables": [
53-
"com.unity.testframework.graphics",
5453
"com.unity.testing.xr"
5554
]
5655
}

Tests/SRPTests/Projects/HDRP_DXR_Tests/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"testables": [
5151
"com.unity.render-pipelines.core",
5252
"com.unity.render-pipelines.high-definition",
53-
"com.unity.testframework.graphics",
5453
"com.unity.testing.hdrp",
5554
"com.unity.testing.xr"
5655
]

Tests/SRPTests/Projects/HDRP_RuntimeTests/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"testables": [
5151
"com.unity.render-pipelines.core",
5252
"com.unity.render-pipelines.high-definition",
53-
"com.unity.testframework.graphics",
5453
"com.unity.testing.hdrp",
5554
"com.unity.testing.xr"
5655
]

Tests/SRPTests/Projects/HDRP_Tests/Packages/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"testables": [
5656
"com.unity.render-pipelines.core",
5757
"com.unity.render-pipelines.high-definition",
58-
"com.unity.testframework.graphics",
5958
"com.unity.testing.hdrp",
6059
"com.unity.testing.xr",
6160
"com.unity.shadergraph",

Tests/SRPTests/Projects/ShaderGraph/Packages/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
},
5050
"disableProjectUpdate": true,
5151
"testables": [
52-
"com.unity.shadergraph",
53-
"com.unity.testframework.graphics"
52+
"com.unity.shadergraph"
5453
]
5554
}

Tests/SRPTests/Projects/ShaderGraphUniversalStereo/Packages/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"disableProjectUpdate": true,
4949
"testables": [
5050
"com.unity.render-pipelines.core",
51-
"com.unity.render-pipelines.universal",
52-
"com.unity.testframework.graphics"
51+
"com.unity.render-pipelines.universal"
5352
]
5453
}

Tests/SRPTests/Projects/UniversalGfxTestStereo/Packages/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"disableProjectUpdate": true,
4949
"testables": [
5050
"com.unity.render-pipelines.core",
51-
"com.unity.render-pipelines.universal",
52-
"com.unity.testframework.graphics"
51+
"com.unity.render-pipelines.universal"
5352
]
5453
}

0 commit comments

Comments
 (0)