Add run_webgpu_cts.py wrapper script

This CL adds a wrapper script around run_web_tests.py for running
the WebGPU CTS. The CTS can understand some test expectations directly, and
this script will be updated in future patches to pass some of the expectations
for run_web_tests.py to the CTS Javascript harness.

This CL also moves blink/tools/extract_expectation_names.py to
third_party/webgpu-cts/scripts because it is used exclusively for WebGPU CTS
variant generation.

Bug: chromium:1186320
Change-Id: I3d2578c0dd42744912fdc6621eaef9cdb54b8234
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2783224
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Dirk Pranke <[email protected]>
Commit-Queue: Austin Eng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#866153}
diff --git a/BUILD.gn b/BUILD.gn
index 881261b8..9ce277c4 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1220,16 +1220,22 @@
     # This target differs from :blink_web_tests in that it uses the same
     # test harness and a few additional flags but, more importantly, only runs
     # the web_tests/wpt_internal/webgpu tests, so it doesn't have a data
-    # dependency on the whole web_test directory.
+    # dependency on the whole web_test directory. run_webgpu_cts.py is a wrapper
+    # script around run_web_tests.py which performs additional setup for running
+    # the WebGPU CTS.
     script = _common_web_test_script
-    args =
-        _common_web_test_args + [
-          "--additional-driver-flag=--enable-unsafe-webgpu",
-          "--ignore-default-expectations",
-          "--additional-expectations",
-          "@WrappedPath(../../third_party/blink/web_tests/WebGPUExpectations)",
-          "--isolated-script-test-filter=wpt_internal/webgpu/*",
-        ]
+
+    # Add run_webgpu_cts.py and remove run_web_tests.py from _common_web_test_args
+    args = [ "@WrappedPath(" +
+             rebase_path("//third_party/blink/tools/run_webgpu_cts.py",
+                         root_build_dir) + ")" ] + _common_web_test_args -
+           [ _common_web_test_args[0] ]
+    args += [
+      "--webgpu-cts-expectations",
+      "@WrappedPath(../../third_party/blink/web_tests/WebGPUExpectations)",
+      "--additional-driver-flag=--enable-unsafe-webgpu",
+      "--isolated-script-test-filter=wpt_internal/webgpu/*",
+    ]
 
     data_deps = [
       ":blink_web_tests_support_data",
@@ -1238,6 +1244,7 @@
     data = [
       "//third_party/blink/web_tests/WebGPUExpectations",
       "//third_party/blink/web_tests/external/wpt/webgpu/",
+      "//third_party/webgpu-cts/scripts/",
     ]
   }