summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/canvas/getPreferredCanvasFormat.spec.ts
blob: 0d966bc81207bdf5edb337a821695154c98f780b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export const description = `
Tests for navigator.gpu.getPreferredCanvasFormat.
`;

import { Fixture } from '../../../common/framework/fixture.js';
import { makeTestGroup } from '../../../common/framework/test_group.js';

export const g = makeTestGroup(Fixture);

g.test('value')
  .desc(
    `
    Ensure getPreferredCanvasFormat returns one of the valid values.
    `
  )
  .fn(async t => {
    const preferredFormat = navigator.gpu.getPreferredCanvasFormat();
    t.expect(preferredFormat === 'bgra8unorm' || preferredFormat === 'rgba8unorm');
  });