Skip to content

Commit 55d56ef

Browse files
Fix api,operation,adapter,requestDevice:invalid test (#4417)
This PR addresses #4336 (comment) Spec change: gpuweb/gpuweb#4789
1 parent 7d143a9 commit 55d56ef

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/webgpu/api/operation/adapter/requestDevice.spec.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ potentially limited native resources.
88
import { Fixture } from '../../../../common/framework/fixture.js';
99
import { makeTestGroup } from '../../../../common/framework/test_group.js';
1010
import { getGPU } from '../../../../common/util/navigator_gpu.js';
11-
import { assert, assertReject, raceWithRejectOnTimeout } from '../../../../common/util/util.js';
11+
import { assert, assertReject } from '../../../../common/util/util.js';
1212
import {
1313
getDefaultLimitsForCTS,
1414
kFeatureNames,
@@ -69,8 +69,7 @@ g.test('invalid')
6969
Test that requesting device on an invalid adapter resolves with lost device.
7070
- Induce invalid adapter via a device lost from a device.destroy()
7171
- Check the device is lost with reason 'destroyed'
72-
- Try creating another device on the now-stale adapter
73-
- Check that returns a device lost with 'unknown'
72+
- Try creating another device on the now-stale adapter fails.
7473
`
7574
)
7675
.fn(async t => {
@@ -87,12 +86,8 @@ g.test('invalid')
8786
t.expect(lostInfo.reason === 'destroyed');
8887
}
8988

90-
// The adapter should now be invalid since a device was lost. Requesting another device should
91-
// return an already lost device.
92-
const kTimeoutMS = 1000;
93-
const device = await t.requestDeviceTracked(adapter);
94-
const lost = await raceWithRejectOnTimeout(device.lost, kTimeoutMS, 'device was not lost');
95-
t.expect(lost.reason === 'unknown');
89+
// The adapter should now be invalid since a device was lost. Requesting another device is not possible anymore.
90+
t.shouldReject('OperationError', t.requestDeviceTracked(adapter));
9691
});
9792

9893
g.test('stale')

0 commit comments

Comments
 (0)