Skip to content

Commit

Permalink
[cts] Support the new binary cache file format
Browse files Browse the repository at this point in the history
Once gpuweb/cts#3094 lands and rolls, the case cache will move from JSON to binary. The fetch() needs to handle this change of encoding.

Change-Id: Iecc8ead12bdff2d64bc3bf129022bf4686ce70d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/158061
Commit-Queue: Ben Clayton <[email protected]>
Auto-Submit: Ben Clayton <[email protected]>
Reviewed-by: Austin Eng <[email protected]>
Commit-Queue: Austin Eng <[email protected]>
Kokoro: Kokoro <[email protected]>
Kokoro: Ben Clayton <[email protected]>
  • Loading branch information
ben-clayton authored and Dawn LUCI CQ committed Oct 25, 2023
1 parent b9ca57d commit b8b17ce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions webgpu-cts/test_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ async function runCtsTestViaSocket(event) {

dataCache.setStore({
load: async (path) => {
return await (await fetch(`/third_party/webgpu-cts/cache/data/${path}`)).text();
if (path.endsWith('.json')) {
// TODO(bclayton): Remove this once https://github.com/gpuweb/cts/pull/3094 lands and rolls.
return await (await fetch(`/third_party/webgpu-cts/cache/data/${path}`)).text();
} else {
const response = await fetch(`/third_party/webgpu-cts/cache/data/${path}`);
return new Uint8Array(await response.arrayBuffer());
}
}
});

Expand Down Expand Up @@ -278,8 +284,8 @@ function sendMessageTestFinished() {

function sendMessageInfraFailure(message) {
socket.send(JSON.stringify({
'type': 'INFRA_FAILURE',
'message': message,
'type': 'INFRA_FAILURE',
'message': message,
}));
}

Expand Down

0 comments on commit b8b17ce

Please sign in to comment.