A test class to help test error scopes and uncapturederror events.

Hierarchy

Properties

_device: undefined | GPUDevice = undefined

Accessors

  • get params(): unknown
  • Returns the (case+subcase) parameters for this test function invocation.

    Returns unknown

  • get sharedState(): S
  • Gets the test fixture's shared state. This object is shared between subcases within the same testcase.

    Returns S

Methods

  • Parameters

    • error: Promise<undefined | Error | (undefined | Error)[]>
    • __namedParameters: {
          mode?: "fail" | "warn";
      } = {}
      • Optional mode?: "fail" | "warn"

    Returns void

  • If the argument is an Error, fail (or warn). If it's undefined, no-op. If the argument is an array, apply the above behavior on each of elements.

    Parameters

    • error: undefined | Error | (undefined | Error)[]
    • __namedParameters: {
          mode?: "fail" | "warn";
          niceStack?: Error;
      } = {}
      • Optional mode?: "fail" | "warn"
      • Optional niceStack?: Error

    Returns void

  • Expect an uncapturederror event to occur. Note: this MUST be awaited, because otherwise it could erroneously pass by capturing an error from later in the test.

    Parameters

    • fn: Function

    Returns Promise<GPUUncapturedErrorEvent>

  • Generates an error of the given filter type. For now, the errors are generated by calling a known code-path to cause the error. This can be updated in the future should there be a more direct way to inject errors.

    Parameters

    • filter: GPUErrorFilter

    Returns void

  • Checks whether the error is of the type expected given the filter.

    Parameters

    • filter: GPUErrorFilter
    • error: null | GPUError

    Returns boolean

  • Expect that the provided function throws (if true or string) or not (if false). If a string is provided, expect that the throw exception has that name.

    MAINTENANCE_TODO: Change to string | false so the exception name is always checked.

    Parameters

    • expectedError: string | boolean
    • fn: (() => void)
        • (): void
        • Returns void

    • __namedParameters: ExceptionCheckOptions = {}

    Returns void

  • Tracks an object to be cleaned up after the test finishes.

    Usually when creating buffers/textures/query sets, you can use the helpers in GPUTest instead.

    Type Parameters

    • T extends DestroyableObject | Promise<DestroyableObject>

    Parameters

    • o: T

    Returns T

Generated using TypeDoc