[cts] Address review feedback
From https://dawn-review.googlesource.com/c/dawn/+/160090.
Change-Id: I61f339b84f609bb569617e7df4842dc848edebee
Cq-Include-Trybots: luci.chromium.try:android-dawn-arm-rel,android-dawn-arm64-rel,dawn-try-mac-arm64-rel,dawn-try-win10-x86-rel,linux-dawn-rel,mac-dawn-rel,win-dawn-rel
Include-Ci-Only-Tests: true
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/161017
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/third_party/gn/webgpu-cts/BUILD.gn b/third_party/gn/webgpu-cts/BUILD.gn
index 57c5766..f9f71cb 100644
--- a/third_party/gn/webgpu-cts/BUILD.gn
+++ b/third_party/gn/webgpu-cts/BUILD.gn
@@ -89,6 +89,12 @@
}
action("copy_resources") {
+ # Note: We use a python script to perform the copy here instead of a "copy"
+ # action because of limitations of source expansions. This copy needs to:
+ # * move files to outside the target's directory
+ # * remove '/src/' from within the path
+ # * copy subdirectories.
+ # It does not seem possible to do all of these things with a source expansion.
src_dir = "../../webgpu-cts/src/resources/"
dst_dir = "$target_gen_dir/../../webgpu-cts/resources/"
diff --git a/tools/src/cmd/run-cts/chrome/cmd.go b/tools/src/cmd/run-cts/chrome/cmd.go
index 1637dce..6de7500 100644
--- a/tools/src/cmd/run-cts/chrome/cmd.go
+++ b/tools/src/cmd/run-cts/chrome/cmd.go
@@ -259,7 +259,6 @@
if c.flags.Verbose {
chromedp.ListenTarget(runCtx, func(ev interface{}) {
- // log.Printf("%T", ev)
switch ev := ev.(type) {
case *runtime.EventConsoleAPICalled:
args := make([]string, len(ev.Args))
diff --git a/tools/src/cmd/run-cts/common/builder.go b/tools/src/cmd/run-cts/common/builder.go
index 0d79926..7f4b904 100644
--- a/tools/src/cmd/run-cts/common/builder.go
+++ b/tools/src/cmd/run-cts/common/builder.go
@@ -124,6 +124,9 @@
if err != nil {
return fmt.Errorf("%w: %v", err, string(out))
}
+ if verbose {
+ fmt.Println(string(out))
+ }
}
return nil
diff --git a/webgpu-cts/test_runner.js b/webgpu-cts/test_runner.js
index bfa9763..26729ff 100644
--- a/webgpu-cts/test_runner.js
+++ b/webgpu-cts/test_runner.js
@@ -123,8 +123,8 @@
const fullPath = getResourcePath(`cache/${path}`);
const response = await fetch(fullPath);
if (!response.ok) {
- sendMessageTestLogString(`failed to load cache file: ${fullPath}`)
- return Promise.reject(response.statusText);
+ return Promise.reject(`failed to load cache file: '${fullPath}'
+reason: ${response.statusText}`);
}
return new Uint8Array(await response.arrayBuffer());
}
@@ -279,13 +279,6 @@
});
}
-function sendMessageTestLogString(msg) {
- socket.send(JSON.stringify({
- 'type': 'TEST_LOG',
- 'log': msg + "\n"
- }));
-}
-
function sendMessageTestFinished() {
socket.send('{"type":"TEST_FINISHED"}');
}