Skip to content

Commit

Permalink
Add WebGPU CTS GPU integration test
Browse files Browse the repository at this point in the history
Adds and updates the necessary files to run the WebGPU CTS tests in the
GPU integration test framework. Does not actually enable any tests yet,
as those will be migrated at a later time in chunks.

Relies on crrev.com/c/3472696 landing first.

Bug: 1297379
Change-Id: I41c0cc74dd7a9f01faf6192609fafed9072e0d3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3473402
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Cr-Commit-Position: refs/heads/main@{#983022}
  • Loading branch information
Brian Sheedy authored and Chromium LUCI CQ committed Mar 19, 2022
1 parent 37b4045 commit c601f46
Show file tree
Hide file tree
Showing 31 changed files with 3,761 additions and 44 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -215,6 +215,7 @@ vs-chromium-project.txt
/content/test/data/gpu/mediapipe_zip/mediapipe_chromium_tests.zip
/content/test/data/layout_tests/
/content/test/data/plugin/
/content/test/gpu/.webgpu_typescript/
/content/web_ui_test_mojo_bindings.xml
/data
/delegate_execute
Expand Down
5 changes: 5 additions & 0 deletions .vpython3
Expand Up @@ -337,6 +337,11 @@ wheel: <
>
>

wheel: <
name: "infra/python/wheels/websockets-py3"
version: "version:10.1"
>

# Used by:
# //tools/infra/find_bad_builds.py
wheel: <
Expand Down
1 change: 1 addition & 0 deletions chrome/test/BUILD.gn
Expand Up @@ -9969,6 +9969,7 @@ if (!is_android && !is_fuchsia) {

data_deps = [
"//content/test:telemetry_gpu_unittest_data",
"//content/test:webgpu_cts_scripts",
"//testing:test_scripts_shared",
]
}
Expand Down
30 changes: 30 additions & 0 deletions content/test/BUILD.gn
Expand Up @@ -786,13 +786,43 @@ group("telemetry_gpu_integration_test_support") {
":telemetry_gpu_integration_test_data",

# For WebGPU CTS tests.
":webgpu_cts_js",
":webgpu_cts_scripts",
":webgpu_cts_test_page",
"//third_party/dawn/third_party/gn/webgpu-cts",

# For anything using Skia Gold (pixel, maps).
"//ui/base:goldctl",
]
}

# This needs to be copied to the output directory since the CTS tests also
# serve resources that are copied into it.
copy("webgpu_cts_test_page") {
testonly = true
sources = [
"//third_party/blink/web_tests/wpt_internal/webgpu/cts_chrome.https.html",
]
outputs = [ "$target_gen_dir/cts_chrome.https.html" ]
}

copy("webgpu_cts_js") {
testonly = true
sources = [ "//third_party/webgpu-cts/chrome_telemetry.js" ]
outputs = [ "$target_gen_dir/chrome_telemetry.js" ]
}

group("webgpu_cts_scripts") {
testonly = true
data = [
"//third_party/node/",
"//third_party/webgpu-cts/scripts/",
"//third_party/webgpu-cts/src/src/",
"//third_party/webgpu-cts/src/node.tsconfig.json",
"//third_party/webgpu-cts/src/tsconfig.json",
]
}

group("telemetry_gpu_common_data") {
testonly = true
data = [
Expand Down
22 changes: 22 additions & 0 deletions content/test/gpu/PRESUBMIT.py
Expand Up @@ -90,6 +90,7 @@ def CommonChecks(input_api, output_api):
results.extend(input_api.RunTests(pylint_checks))

results.extend(CheckForNewSkipExpectations(input_api, output_api))
results.extend(CheckForWebGpuExpectationSync(input_api, output_api))

return results

Expand Down Expand Up @@ -120,6 +121,27 @@ def CheckForNewSkipExpectations(input_api, output_api):
return result


def CheckForWebGpuExpectationSync(input_api, output_api):
"""Enforces that the WebGPU expectations are synced if the CL touched them."""
webgpu_expectations = input_api.os_path.join(input_api.PresubmitLocalPath(),
'gpu_tests', 'test_expectations',
'webgpu_cts_expectations.txt')
file_filter = lambda f: f.AbsoluteLocalPath() == webgpu_expectations
result = []
for _ in input_api.AffectedFiles(file_filter=file_filter):
check = input_api.Command(name='check_webgpu_expectation_sync',
cmd=[
input_api.python3_executable,
'process_generated_webgpu_expectations.py',
'validate'
],
kwargs={},
message=output_api.PresubmitError,
python3=True)
result.extend(input_api.RunTests([check]))
return result


def CheckChangeOnUpload(input_api, output_api):
return CommonChecks(input_api, output_api)

Expand Down
1 change: 1 addition & 0 deletions content/test/gpu/gpu_path_util/__init__.py
Expand Up @@ -15,6 +15,7 @@
GPU_DATA_RELATIVE_PATH = os.path.join(*_GPU_DATA_RELATIVE_PATH_COMPONENTS)
GPU_DATA_DIR = os.path.join(CHROMIUM_SRC_DIR,
*_GPU_DATA_RELATIVE_PATH_COMPONENTS)
GPU_EXPECTATIONS_DIR = os.path.join(GPU_DIR, 'gpu_tests', 'test_expectations')

TOOLS_PERF_DIR = os.path.join(CHROMIUM_SRC_DIR, 'tools', 'perf')

Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down
Expand Up @@ -54,7 +54,9 @@
# tags: [ display-server-wayland display-server-x ]
# OOP-Canvas
# tags: [ oop-c no-oop-c ]
# results: [ Failure RetryOnFailure Skip ]
# WebGPU Backend Validation
# tags: [ dawn-backend-validation dawn-no-backend-validation ]
# results: [ Failure RetryOnFailure Skip Slow ]
# END TAG HEADER

###############################
Expand Down

0 comments on commit c601f46

Please sign in to comment.