logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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
    object
    WebGLRoundTripFixture
    Implements
    IDisposable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Global.Tests.Editor.WebGL
    Assembly: Tests.Editor.dll
    Syntax
    public sealed class WebGLRoundTripFixture : IDisposable

    Properties

    CopyPaths

    Declaration
    public IReadOnlyCollection<string> CopyPaths { get; }
    Property Value
    Type Description
    IReadOnlyCollection<string>

    DestinationRoot

    Declaration
    public string DestinationRoot { get; }
    Property Value
    Type Description
    string

    GroupName

    Declaration
    public string GroupName { get; }
    Property Value
    Type Description
    string

    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
    Type Description
    string

    SettingsAssetPath

    Declaration
    public string SettingsAssetPath { get; }
    Property Value
    Type Description
    string

    SettingsLabels

    Declaration
    public IReadOnlyCollection<string> SettingsLabels { get; }
    Property Value
    Type Description
    IReadOnlyCollection<string>

    SourceFolder

    Declaration
    public string SourceFolder { get; }
    Property Value
    Type Description
    string

    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
    Type Description
    string

    CopyOf(string)

    Declaration
    public string CopyOf(string shippedAssetPath)
    Parameters
    Type Name Description
    string shippedAssetPath
    Returns
    Type Description
    string

    CopyPathInSourceFolder(string)

    Declaration
    public string CopyPathInSourceFolder(string shippedAssetPath)
    Parameters
    Type Name Description
    string shippedAssetPath
    Returns
    Type Description
    string

    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
    Type Description
    string

    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
    Type Description
    string

    DescribeRegistration(string)

    Declaration
    public string DescribeRegistration(string guid)
    Parameters
    Type Name Description
    string guid
    Returns
    Type Description
    string

    Dispose()

    Declaration
    public void Dispose()

    EntryOf(string)

    Declaration
    public AddressableAssetEntry EntryOf(string assetPath)
    Parameters
    Type Name Description
    string assetPath
    Returns
    Type Description
    AddressableAssetEntry

    Export()

    Exports the fixture's group into DestinationRoot, failing if the export touched any real project content (see WebGLRoundTripContentGuard).

    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
    public void Flush()

    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
    Type Description
    WebGLRoundTripFixture

    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
    Type Name Description
    IReadOnlyDictionary<string, string> destinationByShippedAssetPath

    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
    Type Name Description
    IReadOnlyDictionary<string, string> destinationByShippedAssetPath

    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
    Type Name Description
    IReadOnlyCollection<string> expectedChangesOutsideTheFixture
    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
    Type Description
    Dictionary<string, byte[]>

    Implements

    IDisposable
    In this article
    © 2026 Serenity. All Rights Reserved