Skip to content

Commit c09e68c

Browse files
Add tests for consumed adapter in requestDevice (#4336)
1 parent b5accdb commit c09e68c

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,8 @@ g.test('stale')
173173
);
174174
}
175175

176-
const kTimeoutMS = 1000;
177-
const lostDevice = await t.requestDeviceTracked(adapter);
178-
const lost = await raceWithRejectOnTimeout(
179-
lostDevice.lost,
180-
kTimeoutMS,
181-
'adapter was not stale'
182-
);
183-
t.expect(lost.reason === 'unknown');
184-
185-
// Make sure to destroy the valid device after trying to get a second one. Otherwise, the second
186-
// device may fail because the adapter is put into an invalid state from the destroy.
187-
if (device) {
188-
device.destroy();
189-
}
176+
// Since the adapter is consumed now, requesting another device is not possible anymore.
177+
t.shouldReject('OperationError', t.requestDeviceTracked(adapter));
190178
});
191179

192180
g.test('features,unknown')

0 commit comments

Comments
 (0)