From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../depth_sensing_cpu_dataUnavailable.https.html | 27 +++++ .../cpu/depth_sensing_cpu_inactiveFrame.https.html | 26 +++++ .../depth_sensing_cpu_incorrectUsage.https.html | 48 +++++++++ ...ensing_cpu_luminance_alpha_dataValid.https.html | 110 +++++++++++++++++++++ .../cpu/depth_sensing_cpu_staleView.https.html | 26 +++++ .../webxr/depth-sensing/dataUnavailableTests.js | 58 +++++++++++ .../depth_sensing_notEnabled.https.html | 61 ++++++++++++ .../depth_sensing_gpu_dataUnavailable.https.html | 27 +++++ .../gpu/depth_sensing_gpu_inactiveFrame.https.html | 26 +++++ .../depth_sensing_gpu_incorrectUsage.https.html | 46 +++++++++ .../gpu/depth_sensing_gpu_staleView.https.html | 26 +++++ .../webxr/depth-sensing/inactiveFrameTests.js | 36 +++++++ .../tests/webxr/depth-sensing/staleViewsTests.js | 39 ++++++++ 13 files changed, 556 insertions(+) create mode 100644 testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/dataUnavailableTests.js create mode 100644 testing/web-platform/tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html create mode 100644 testing/web-platform/tests/webxr/depth-sensing/inactiveFrameTests.js create mode 100644 testing/web-platform/tests/webxr/depth-sensing/staleViewsTests.js (limited to 'testing/web-platform/tests/webxr/depth-sensing') diff --git a/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html new file mode 100644 index 0000000000..e120f0b7dd --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_dataUnavailable.https.html @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html new file mode 100644 index 0000000000..92c20cecbf --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_inactiveFrame.https.html @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html new file mode 100644 index 0000000000..44868d8cb0 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_incorrectUsage.https.html @@ -0,0 +1,48 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html new file mode 100644 index 0000000000..db88c42558 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_luminance_alpha_dataValid.https.html @@ -0,0 +1,110 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html new file mode 100644 index 0000000000..6a411ace45 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/cpu/depth_sensing_cpu_staleView.https.html @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/dataUnavailableTests.js b/testing/web-platform/tests/webxr/depth-sensing/dataUnavailableTests.js new file mode 100644 index 0000000000..7460af7132 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/dataUnavailableTests.js @@ -0,0 +1,58 @@ +'use strict'; + +const TestStates = Object.freeze({ + "ShouldSucceedScheduleRAF": 1, + "ShouldFailScheduleRAF": 2, + "ShouldSucceedTestDone": 3, +}); + +const dataUnavailableTestFunctionGenerator = function(isCpuOptimized) { + return (session, controller, t, sessionObjects) => { + let state = TestStates.ShouldSucceedScheduleRAF; + + return session.requestReferenceSpace('viewer').then((viewerSpace) => { + let done = false; + + const glBinding = new XRWebGLBinding(session, sessionObjects.gl); + + const rafCb = function(time, frame) { + const pose = frame.getViewerPose(viewerSpace); + for(const view of pose.views) { + const depthInformation = isCpuOptimized ? frame.getDepthInformation(view) + : glBinding.getDepthInformation(view); + + if (state == TestStates.ShouldSucceedScheduleRAF + || state == TestStates.ShouldSucceedTestDone) { + t.step(() => { + assert_not_equals(depthInformation, null); + }); + } else { + t.step(() => { + assert_equals(depthInformation, null); + }); + } + } + + switch(state) { + case TestStates.ShouldSucceedScheduleRAF: + controller.clearDepthSensingData(); + state = TestStates.ShouldFailScheduleRAF; + session.requestAnimationFrame(rafCb); + break; + case TestStates.ShouldFailScheduleRAF: + controller.setDepthSensingData(DEPTH_SENSING_DATA); + state = TestStates.ShouldSucceedTestDone; + session.requestAnimationFrame(rafCb); + break; + case TestStates.ShouldSucceedTestDone: + done = true; + break; + } + }; + + session.requestAnimationFrame(rafCb); + + return t.step_wait(() => done); + }); + }; +}; \ No newline at end of file diff --git a/testing/web-platform/tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html b/testing/web-platform/tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html new file mode 100644 index 0000000000..23bae35493 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/depth_sensing_notEnabled.https.html @@ -0,0 +1,61 @@ + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html new file mode 100644 index 0000000000..018edf7693 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_dataUnavailable.https.html @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html new file mode 100644 index 0000000000..6116f7a041 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_inactiveFrame.https.html @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html new file mode 100644 index 0000000000..9fc2e6a5f8 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_incorrectUsage.https.html @@ -0,0 +1,46 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html new file mode 100644 index 0000000000..ecd0d479f7 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/gpu/depth_sensing_gpu_staleView.https.html @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/webxr/depth-sensing/inactiveFrameTests.js b/testing/web-platform/tests/webxr/depth-sensing/inactiveFrameTests.js new file mode 100644 index 0000000000..b310f01ef8 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/inactiveFrameTests.js @@ -0,0 +1,36 @@ +'use strict'; + +const inactiveFrameTestFunctionGenerator = function(isCpuOptimized) { + return (session, controller, t, sessionObjects) => { + return session.requestReferenceSpace('viewer').then((viewerSpace) => { + let callbacksKickedOff = false; + let callbackCounter = 0; + + const glBinding = new XRWebGLBinding(session, sessionObjects.gl); + + const rafCb = function(time, frame) { + const pose = frame.getViewerPose(viewerSpace); + for(const view of pose.views) { + const callback = () => { + t.step(() => { + assert_throws_dom("InvalidStateError", + () => isCpuOptimized ? frame.getDepthInformation(view) + : glBinding.getDepthInformation(view), + "getDepthInformation() should throw when ran outside RAF"); + }); + callbackCounter--; + } + + t.step_timeout(callback, 10); + callbackCounter++; + } + + callbacksKickedOff = true; + }; + + session.requestAnimationFrame(rafCb); + + return t.step_wait(() => callbacksKickedOff && (callbackCounter == 0)); + }); + }; +}; diff --git a/testing/web-platform/tests/webxr/depth-sensing/staleViewsTests.js b/testing/web-platform/tests/webxr/depth-sensing/staleViewsTests.js new file mode 100644 index 0000000000..b1f11c9651 --- /dev/null +++ b/testing/web-platform/tests/webxr/depth-sensing/staleViewsTests.js @@ -0,0 +1,39 @@ +'use strict'; + +const staleViewsTestFunctionGenerator = function(isCpuOptimized) { + return (session, controller, t, sessionObjects) => { + let done = false; + + const staleViews = new Set(); + + return session.requestReferenceSpace('viewer').then((viewerSpace) => { + const glBinding = new XRWebGLBinding(session, sessionObjects.gl); + + const secondRafCb = function(time, frame) { + for(const view of staleViews) { + t.step(() => { + assert_throws_dom("InvalidStateError", + () => isCpuOptimized ? frame.getDepthInformation(view) + : glBinding.getDepthInformation(view), + "getDepthInformation() should throw when run with stale XRView"); + }); + } + + done = true; + }; + + const firstRafCb = function(time, frame) { + const pose = frame.getViewerPose(viewerSpace); + for(const view of pose.views) { + staleViews.add(view); + } + + session.requestAnimationFrame(secondRafCb); + }; + + session.requestAnimationFrame(firstRafCb); + + return t.step_wait(() => done); + }); + }; +}; \ No newline at end of file -- cgit v1.2.3