Class WebGLRoundTripFixture
The world a WebGL Export → Remove round trip runs in: copies of real shipped assets under a throwaway
project folder, registered in an Addressables group of their own with the labels of the shipped original,
and a Resources destination beside them. Dispose() removes the group, every entry of the
fixture's assets and the whole folder, whatever the test left behind.
The exporter's contract is to export shipped package content — the menu command exports the real Serenity
group, whose assets all live in the package, and moves every runtime-safe dependency they reach, package
content included. So the exporter cannot be what keeps a test away from the real project; this fixture
is. It runs every Export and Remove through Export() and Remove(), which point
the exporter at the fixture's own group only and wrap each call in a WebGLRoundTripContentGuard:
the call fails loudly, naming the file or the asset, if it moved, rewrote, added or removed anything in the
shipped package tree, the project's Resources folder or the Addressables data — the real Serenity
group included — instead of relying on the copies happening to reach nothing real.
Inheritance
WebGLRoundTripFixture
Assembly: Tests.Editor.dll
Syntax
public sealed class WebGLRoundTripFixture : IDisposable
Properties
CopyPaths
Declaration
public IReadOnlyCollection<string> CopyPaths { get; }
Property Value
DestinationRoot
Declaration
public string DestinationRoot { get; }
Property Value
GroupName
Declaration
public string GroupName { get; }
Property Value
Label
The label LabelWithTheFixtureLabel(string) puts on an entry — one no shipped asset
carries, so a test may remove it from the settings without touching a real registration.
Declaration
public string Label { get; }
Property Value
SettingsAssetPath
Declaration
public string SettingsAssetPath { get; }
Property Value
SettingsLabels
Declaration
public IReadOnlyCollection<string> SettingsLabels { get; }
Property Value
SourceFolder
Declaration
public string SourceFolder { get; }
Property Value
Methods
AnnounceAnAddressablesEntryChange()
Raises the Addressables "entry modified" event the way any later registration in the editor
does — the event the audio player answers by re-deriving every clip definition's clip path.
Declaration
public void AnnounceAnAddressablesEntryChange()
AudioClipPathOf(string)
Declaration
public string AudioClipPathOf(string audioDefinitionPath)
Parameters
| Type |
Name |
Description |
| string |
audioDefinitionPath |
|
Returns
CopyOf(string)
Declaration
public string CopyOf(string shippedAssetPath)
Parameters
| Type |
Name |
Description |
| string |
shippedAssetPath |
|
Returns
CopyPathInSourceFolder(string)
Declaration
public string CopyPathInSourceFolder(string shippedAssetPath)
Parameters
| Type |
Name |
Description |
| string |
shippedAssetPath |
|
Returns
DeleteTheGroup()
Deletes the fixture's group, the way an author deletes a group in the Groups window.
Declaration
public void DeleteTheGroup()
DescribeCopies()
One line per copy — its path, its GUID and its Addressables registration — sorted, so two
snapshots compare as one readable diff.
Declaration
public string DescribeCopies()
Returns
DescribeFolderTree()
Every folder and file under the fixture's own project root, .meta files included,
as sorted root-relative paths — so two snapshots compare as one readable diff.
Declaration
public string DescribeFolderTree()
Returns
DescribeRegistration(string)
Declaration
public string DescribeRegistration(string guid)
Parameters
| Type |
Name |
Description |
| string |
guid |
|
Returns
Dispose()
Declaration
EntryOf(string)
Declaration
public AddressableAssetEntry EntryOf(string assetPath)
Parameters
| Type |
Name |
Description |
| string |
assetPath |
|
Returns
| Type |
Description |
| AddressableAssetEntry |
|
Export()
Declaration
public SerenityWebGLResourcesExporter.ExportReport Export()
Returns
| Type |
Description |
| ExportReport |
|
Export(string)
Exports the fixture's group into destinationRoot under the same guard —
for a test that hands the exporter a destination it must refuse.
Declaration
public SerenityWebGLResourcesExporter.ExportReport Export(string destinationRoot)
Parameters
| Type |
Name |
Description |
| string |
destinationRoot |
|
Returns
| Type |
Description |
| ExportReport |
|
Flush()
Declaration
LabelWithTheFixtureLabel(string)
Adds Label to the settings and to the entry of assetPath.
Declaration
public void LabelWithTheFixtureLabel(string assetPath)
Parameters
| Type |
Name |
Description |
| string |
assetPath |
|
MarkReadOnlyAndFlaggedForContentUpdate(string)
Marks the entry of assetPath read-only and flagged by a content update
restriction check — the two entry properties besides group, address and labels that a group asset
persists.
Declaration
public void MarkReadOnlyAndFlaggedForContentUpdate(string assetPath)
Parameters
| Type |
Name |
Description |
| string |
assetPath |
|
Open()
Declaration
public static WebGLRoundTripFixture Open()
Returns
PlaceCopies(IReadOnlyDictionary<string, string>)
Copies each shipped asset to the destination the caller names, without registering it.
Declaration
public void PlaceCopies(IReadOnlyDictionary<string, string> destinationByShippedAssetPath)
Parameters
PlaceRegisteredCopies(params string[])
Copies each shipped asset into SourceFolder, registers every copy the way its
original is registered, and aligns each copied audio definition's clip path with its copied clip — so
the world starts exactly as consistent as a project the Serenity tools maintain.
Declaration
public void PlaceRegisteredCopies(params string[] shippedAssetPaths)
Parameters
| Type |
Name |
Description |
| string[] |
shippedAssetPaths |
|
PlaceRegisteredCopiesAsShipped(params string[])
Copies each shipped asset into SourceFolder byte for byte — no re-serialization
and no clip path alignment, so each copy keeps the exact serialized form the package ships — and
registers every copy the way its original is registered.
Declaration
public void PlaceRegisteredCopiesAsShipped(params string[] shippedAssetPaths)
Parameters
| Type |
Name |
Description |
| string[] |
shippedAssetPaths |
|
PlaceRegisteredCopiesAt(IReadOnlyDictionary<string, string>)
Copies each shipped asset to the destination the caller names — creating the folders a
destination needs below SourceFolder — and registers every copy the way its original is
registered. For assets whose file names collide, which the source folder alone cannot hold.
Declaration
public void PlaceRegisteredCopiesAt(IReadOnlyDictionary<string, string> destinationByShippedAssetPath)
Parameters
RegisterLikeTheShippedOriginal(string)
Registers the copy of shippedAssetPath in the fixture's group with the
shipped original's labels and an address of its own — one no rule derives from the copy's path, so
only a restore of the recorded address can bring it back.
Declaration
public void RegisterLikeTheShippedOriginal(string shippedAssetPath)
Parameters
| Type |
Name |
Description |
| string |
shippedAssetPath |
|
Remove()
Removes the export at DestinationRoot, failing if the removal touched any
real project content.
Declaration
public SerenityWebGLResourcesCleaner.CleanupReport Remove()
Returns
| Type |
Description |
| CleanupReport |
|
Remove(IReadOnlyCollection<string>)
Removes the export at DestinationRoot, failing unless the real project files
it changed are exactly expectedChangesOutsideTheFixture.
Declaration
public SerenityWebGLResourcesCleaner.CleanupReport Remove(IReadOnlyCollection<string> expectedChangesOutsideTheFixture)
Parameters
Returns
| Type |
Description |
| CleanupReport |
|
RemoveTheFixtureLabelFromTheSettings()
Deletes Label from the settings' label table, the way an author removes a
label in the Labels window.
Declaration
public void RemoveTheFixtureLabelFromTheSettings()
SnapshotBytes()
The bytes of every copy, its .meta and the fixture's group asset, keyed by path —
taken after a flush so they are what is on disk. A missing file maps to null.
Declaration
public Dictionary<string, byte[]> SnapshotBytes()
Returns
Implements