Changeset 265546 in webkit


Ignore:
Timestamp:
Aug 12, 2020 4:06:45 AM (4 years ago)
Author:
svillar@igalia.com
Message:

[WebXR] Update WebXR WPT directory
https://bugs.webkit.org/show_bug.cgi?id=215224

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

  • web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html: Added.
  • web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html: Added.
  • web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html: Added.
  • web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html: Added.
  • web-platform-tests/webxr/anchors/ar_anchor_states.https.html: Added.
  • web-platform-tests/webxr/anchors/idlharness.https.window.html: Added.
  • web-platform-tests/webxr/anchors/idlharness.https.window.js: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js.

(async idl_array):

  • web-platform-tests/webxr/anchors/w3c-import.log: Added.
  • web-platform-tests/webxr/ar-module/idlharness.https.window-expected.txt:
  • web-platform-tests/webxr/ar-module/idlharness.https.window.js:

(async idl_array):

  • web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html:
  • web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html: Added.
  • web-platform-tests/webxr/dom-overlay/idlharness.https.window.html: Added.
  • web-platform-tests/webxr/dom-overlay/idlharness.https.window.js: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js.

(async idl_array):

  • web-platform-tests/webxr/dom-overlay/w3c-import.log:
  • web-platform-tests/webxr/events_input_sources_change.https.html:
  • web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html:
  • web-platform-tests/webxr/events_session_select.https.html:
  • web-platform-tests/webxr/events_session_select_subframe.https.html:
  • web-platform-tests/webxr/events_session_squeeze.https.html:
  • web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html:
  • web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html:
  • web-platform-tests/webxr/getInputPose_handedness.https.html:
  • web-platform-tests/webxr/getInputPose_pointer.https.html:
  • web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html:
  • web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html: Added.
  • web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html:
  • web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states.https.html.
  • web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html: Added.
  • web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html: Added.
  • web-platform-tests/webxr/hit-test/idlharness.https.html: Added.
  • web-platform-tests/webxr/hit-test/w3c-import.log:
  • web-platform-tests/webxr/hit-test/xrRay_constructor.https.html:
  • web-platform-tests/webxr/idlharness.https.window-expected.txt:
  • web-platform-tests/webxr/idlharness.https.window.js:

(async idl_array):

  • web-platform-tests/webxr/render_state_update.https.html: Added.
  • web-platform-tests/webxr/resources/webxr_test_constants.js:
  • web-platform-tests/webxr/resources/webxr_util.js:

(xr_debug):
(async requestSkipAnimationFrame):
(async loadChromiumResources):
(setupWebKitWebXRTestAPI):
(xr_promise_test): Deleted.
(async xr_session_promise_test): Deleted.

  • web-platform-tests/webxr/w3c-import.log:
  • web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html:
  • web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html:
  • web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html: Added.
  • web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html:
  • web-platform-tests/webxr/xrInputSource_add_remove.https.html:
  • web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html:
  • web-platform-tests/webxr/xrInputSource_profiles.https.html:
  • web-platform-tests/webxr/xrInputSource_sameObject.https.html:
  • web-platform-tests/webxr/xrPose_transform_sameObject.https.html:
  • web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html:
  • web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html:
  • web-platform-tests/webxr/xrReferenceSpace_relationships.https.html: Added.
  • web-platform-tests/webxr/xrSession_input_events_end.https.html:
  • web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html:
  • web-platform-tests/webxr/xrSession_sameObject.https.html:
  • web-platform-tests/webxr/xrSession_visibilityState.https.html:
  • web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html:
  • web-platform-tests/webxr/xrWebGLLayer_constructor.https.html:

Source/WebCore:

The update of the WebXR WPT directory helped us to unveil a couple of mistakes in the current code.
First of all the Events defined in the WebXR spec had to be iso allocated as the Event base class.
Secondly the WebXRInputSourceArray must have a ::create() method. Finally the m_inputSources attribute
of the WebXRSession must be a Ref instead of a RefPtr because the specs mention that the initial
value is an empty array.

Tests: imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html

imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html
imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html
imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html
imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html
imported/w3c/web-platform-tests/webxr/anchors/idlharness.https.window.html
imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html
imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.html
imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html
imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html
imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html
imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html
imported/w3c/web-platform-tests/webxr/hit-test/idlharness.https.html
imported/w3c/web-platform-tests/webxr/render_state_update.https.html
imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html
imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html

  • Modules/webxr/WebXRInputSourceArray.cpp:

(WebCore::WebXRInputSourceArray::create): Added.

  • Modules/webxr/WebXRInputSourceArray.h:
  • Modules/webxr/WebXRSession.cpp:

(WebCore::WebXRSession::WebXRSession): Initialize the m_inputSources.
(WebCore::WebXRSession::inputSources const): Return a const reference.

  • Modules/webxr/WebXRSession.h:
  • Modules/webxr/XRInputSourcesChangeEvent.cpp: Make it iso allocated.
  • Modules/webxr/XRInputSourcesChangeEvent.h: Ditto.
  • Modules/webxr/XRSessionEvent.cpp: Ditto.
  • Modules/webxr/XRSessionEvent.h: Ditto.

LayoutTests:

  • platform/wpe/TestExpectations: Skipped one test that started to fail after the import.
Location:
trunk
Files:
17 added
50 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r265543 r265546  
     12020-08-06  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [WebXR] Update WebXR WPT directory
     4        https://bugs.webkit.org/show_bug.cgi?id=215224
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * platform/wpe/TestExpectations: Skipped one test that started to fail after the import.
     9
    1102020-08-12  Chris Lord  <clord@igalia.com>
    211
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r265543 r265546  
     12020-08-06  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [WebXR] Update WebXR WPT directory
     4        https://bugs.webkit.org/show_bug.cgi?id=215224
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html: Added.
     9        * web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html: Added.
     10        * web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html: Added.
     11        * web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html: Added.
     12        * web-platform-tests/webxr/anchors/ar_anchor_states.https.html: Added.
     13        * web-platform-tests/webxr/anchors/idlharness.https.window.html: Added.
     14        * web-platform-tests/webxr/anchors/idlharness.https.window.js: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js.
     15        (async idl_array):
     16        * web-platform-tests/webxr/anchors/w3c-import.log: Added.
     17        * web-platform-tests/webxr/ar-module/idlharness.https.window-expected.txt:
     18        * web-platform-tests/webxr/ar-module/idlharness.https.window.js:
     19        (async idl_array):
     20        * web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html:
     21        * web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html: Added.
     22        * web-platform-tests/webxr/dom-overlay/idlharness.https.window.html: Added.
     23        * web-platform-tests/webxr/dom-overlay/idlharness.https.window.js: Copied from LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js.
     24        (async idl_array):
     25        * web-platform-tests/webxr/dom-overlay/w3c-import.log:
     26        * web-platform-tests/webxr/events_input_sources_change.https.html:
     27        * web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html:
     28        * web-platform-tests/webxr/events_session_select.https.html:
     29        * web-platform-tests/webxr/events_session_select_subframe.https.html:
     30        * web-platform-tests/webxr/events_session_squeeze.https.html:
     31        * web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html:
     32        * web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html:
     33        * web-platform-tests/webxr/getInputPose_handedness.https.html:
     34        * web-platform-tests/webxr/getInputPose_pointer.https.html:
     35        * web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html:
     36        * web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html: Added.
     37        * web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html:
     38        * web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states.https.html.
     39        * web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html: Added.
     40        * web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html: Added.
     41        * web-platform-tests/webxr/hit-test/idlharness.https.html: Added.
     42        * web-platform-tests/webxr/hit-test/w3c-import.log:
     43        * web-platform-tests/webxr/hit-test/xrRay_constructor.https.html:
     44        * web-platform-tests/webxr/idlharness.https.window-expected.txt:
     45        * web-platform-tests/webxr/idlharness.https.window.js:
     46        (async idl_array):
     47        * web-platform-tests/webxr/render_state_update.https.html: Added.
     48        * web-platform-tests/webxr/resources/webxr_test_constants.js:
     49        * web-platform-tests/webxr/resources/webxr_util.js:
     50        (xr_debug):
     51        (async requestSkipAnimationFrame):
     52        (async loadChromiumResources):
     53        (setupWebKitWebXRTestAPI):
     54        (xr_promise_test): Deleted.
     55        (async xr_session_promise_test): Deleted.
     56        * web-platform-tests/webxr/w3c-import.log:
     57        * web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html:
     58        * web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html:
     59        * web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html: Added.
     60        * web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html:
     61        * web-platform-tests/webxr/xrInputSource_add_remove.https.html:
     62        * web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html:
     63        * web-platform-tests/webxr/xrInputSource_profiles.https.html:
     64        * web-platform-tests/webxr/xrInputSource_sameObject.https.html:
     65        * web-platform-tests/webxr/xrPose_transform_sameObject.https.html:
     66        * web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html:
     67        * web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html:
     68        * web-platform-tests/webxr/xrReferenceSpace_relationships.https.html: Added.
     69        * web-platform-tests/webxr/xrSession_input_events_end.https.html:
     70        * web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html:
     71        * web-platform-tests/webxr/xrSession_sameObject.https.html:
     72        * web-platform-tests/webxr/xrSession_visibilityState.https.html:
     73        * web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html:
     74        * web-platform-tests/webxr/xrWebGLLayer_constructor.https.html:
     75
    1762020-08-12  Chris Lord  <clord@igalia.com>
    277
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/anchors/idlharness.https.window.js

    r265545 r265546  
    44'use strict';
    55
    6 // https://immersive-web.github.io/webxr-ar-module/
     6// https://immersive-web.github.io/anchors/
    77
    88idl_test(
    9   ['webxr-ar-module'],
    10   ['webxr', 'dom'],
     9  ['anchors'],
     10  ['hit-test', 'webxr', 'dom'],
    1111  async idl_array => {
    1212    idl_array.add_objects({
    13       // TODO: XRSession
     13      // TODO: Add object instances
    1414    });
    1515  }
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window-expected.txt

    r265239 r265546  
    1010PASS XRSession interface: attribute environmentBlendMode
    1111PASS XRSession interface: attribute interactionMode
     12PASS XRSession interface: xrSession must inherit property "environmentBlendMode" with the proper type
     13PASS XRSession interface: xrSession must inherit property "interactionMode" with the proper type
    1214FAIL XRView interface: attribute isFirstPersonObserver assert_true: The prototype object must have a property "isFirstPersonObserver" expected true got false
    1315
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.js

    r258499 r265546  
    1111  async idl_array => {
    1212    idl_array.add_objects({
    13       // TODO: XRSession
     13      XRSession: ['xrSession'],
    1414    });
     15    self.xrSession = await navigator.xr.requestSession('inline');
    1516  }
    1617);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html

    r258499 r265546  
    107107
    108108let testInput = function(overlayElement, session, fakeDeviceController, t) {
     109  let debug = xr_debug.bind(this, 'testInput');
    109110
    110111  // Use two DIVs for this test. "inner_a" uses a "beforexrselect" handler
     
    136137  session.requestReferenceSpace('viewer').then(function(viewerSpace) {
    137138    // Press the primary input button and then release it a short time later.
    138     session.requestAnimationFrame((time, xrFrame) => {
     139    debug('got viewerSpace');
     140    requestSkipAnimationFrame(session, (time, xrFrame) => {
     141      debug('got rAF 1');
    139142      input_source.setOverlayPointerPosition(inner_a.offsetLeft + 1,
    140143                                             inner_a.offsetTop + 1);
     
    142145
    143146      session.requestAnimationFrame((time, xrFrame) => {
     147        debug('got rAF 2');
    144148        input_source.endSelection();
    145149
    146150        session.requestAnimationFrame((time, xrFrame) => {
     151          debug('got rAF 3');
    147152          // Need to process one more frame to allow select to propagate.
    148153          session.requestAnimationFrame((time, xrFrame) => {
     154            debug('got rAF 4');
    149155            session.dispatchEvent(watcherStep);
    150156
     
    152158
    153159            session.requestAnimationFrame((time, xrFrame) => {
     160              debug('got rAF 5');
    154161              input_source.setOverlayPointerPosition(inner_b.offsetLeft + 1,
    155162                                                     inner_b.offsetTop + 1);
     
    157164
    158165              session.requestAnimationFrame((time, xrFrame) => {
     166                debug('got rAF 6');
    159167                input_source.endSelection();
    160168
    161169                session.requestAnimationFrame((time, xrFrame) => {
     170                  debug('got rAF 7');
    162171                  // Need to process one more frame to allow select to propagate.
    163172                  session.dispatchEvent(watcherDone);
     
    174183
    175184let testCrossOriginContent = function(overlayElement, session, fakeDeviceController, t) {
     185  let debug = xr_debug.bind(this, 'testCrossOriginContent');
     186
    176187  let iframe = document.getElementById('iframe');
    177188  assert_true(iframe != null);
     
    192203  session.requestReferenceSpace('viewer').then(function(viewerSpace) {
    193204    // Press the primary input button and then release it a short time later.
    194     session.requestAnimationFrame((time, xrFrame) => {
     205    requestSkipAnimationFrame(session, (time, xrFrame) => {
     206      debug('got rAF 1');
    195207      input_source.setOverlayPointerPosition(iframe.offsetLeft + 1,
    196208                                             iframe.offsetTop + 1);
     
    198210
    199211      session.requestAnimationFrame((time, xrFrame) => {
     212        debug('got rAF 2');
    200213        input_source.endSelection();
    201214
    202215        session.requestAnimationFrame((time, xrFrame) => {
     216          debug('got rAF 3');
    203217          // Need to process one more frame to allow select to propagate.
    204218          session.requestAnimationFrame((time, xrFrame) => {
     219            debug('got rAF 4');
    205220            session.dispatchEvent(watcherStep);
    206221
    207222            session.requestAnimationFrame((time, xrFrame) => {
     223              debug('got rAF 5');
    208224              input_source.setOverlayPointerPosition(inner_b.offsetLeft + 1,
    209225                                                     inner_b.offsetTop + 1);
     
    211227
    212228              session.requestAnimationFrame((time, xrFrame) => {
     229                debug('got rAF 6');
    213230                input_source.endSelection();
    214231
    215232                session.requestAnimationFrame((time, xrFrame) => {
     233                  debug('got rAF 7');
    216234                  // Need to process one more frame to allow select to propagate.
    217235                  session.dispatchEvent(watcherDone);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js

    r265545 r265546  
    44'use strict';
    55
    6 // https://immersive-web.github.io/webxr-ar-module/
     6// https://immersive-web.github.io/dom-overlays/
    77
    88idl_test(
    9   ['webxr-ar-module'],
    10   ['webxr', 'dom'],
     9  ['dom-overlays'],
     10  ['webxr', 'html', 'dom'],
    1111  async idl_array => {
    1212    idl_array.add_objects({
    13       // TODO: XRSession
     13      // TODO: Add object instances
    1414    });
    1515  }
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/w3c-import.log

    r258499 r265546  
    1616List of files:
    1717/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay.https.html
     18/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html
     19/LayoutTests/imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.js
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_input_sources_change.https.html

    r258499 r265546  
    102102  // Make our input source disappear after one frame, and wait an additional
    103103  // frame for that disappearance to propogate.
    104   session.requestAnimationFrame((time, xrFrame) => {
     104  requestSkipAnimationFrame(session, (time, xrFrame) => {
    105105    input_source.disconnect();
    106106    session.requestAnimationFrame((time, xrFrame) => {});
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_referenceSpace_reset_immersive.https.html

    r258499 r265546  
    4141
    4242  // The triggered resetPose event should arrive after the next Animation Frame
    43   session.requestAnimationFrame(() => {});
     43  requestSkipAnimationFrame(session, () => {});
    4444
    4545  return resetPromise;
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select.https.html

    r258499 r265546  
    9393
    9494      // Press the primary input button and then release it a short time later.
    95       session.requestAnimationFrame((time, xrFrame) => {
     95      requestSkipAnimationFrame(session, (time, xrFrame) => {
    9696        input_source.startSelection();
    9797
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_select_subframe.https.html

    r258499 r265546  
    5252
    5353  // Press the primary input button and then release it a short time later.
    54   session.requestAnimationFrame((time, xrFrame) => {
     54  requestSkipAnimationFrame(session, (time, xrFrame) => {
    5555    input_source.simulateSelect();
    5656
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/events_session_squeeze.https.html

    r258499 r265546  
    115115
    116116      //Simulate a grip starting then release it a short time later.
    117       session.requestAnimationFrame((time, xrFrame) => {
     117      requestSkipAnimationFrame(session, (time, xrFrame) => {
    118118        input_source.updateButtonState(pressed_grip_button);
    119119
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_disconnect.https.html

    r258499 r265546  
    133133  // session, at which point the controller should be disconnected.
    134134  return new Promise((resolve) => {
    135     session.requestAnimationFrame(() => {
     135    requestSkipAnimationFrame(session, () => {
    136136      input_source.setSupportedButtons([]);
    137137      session.requestAnimationFrame(() => {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html

    r258499 r265546  
    7070  //    fire an inputsourceschange event).
    7171  return new Promise((resolve) => {
    72     session.requestAnimationFrame(() => {
     72    requestSkipAnimationFrame(session, () => {
    7373      // Make sure the exposed gamepad has the number of buttons and axes we
    7474      // requested.
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_handedness.https.html

    r258499 r265546  
    7676
    7777    // Handedness only updates during an XR frame.
    78     session.requestAnimationFrame(CheckNone);
     78    requestSkipAnimationFrame(session, CheckNone);
    7979  });
    8080
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/getInputPose_pointer.https.html

    r258499 r265546  
    5252
    5353        t.step( () => {
    54           // When a grip matrix is present but no pointer offset is specified,
    55           // the grip and pointer matrices should be the same.
     54          // When a grip matrix is set, both the grip and pointer matrices
     55          // should yield their set values (i.e. the pointerOrigin is *not*
     56          // transformed by the gripOrigin).
    5657          assert_not_equals(grip_pose, null);
    5758          assert_matrix_approx_equals(grip_pose.transform.matrix, VALID_GRIP,
    5859            FLOAT_EPSILON, "Grip matrix is not equal to input.");
    5960          assert_matrix_approx_equals(input_pose.transform.matrix,
    60             grip_pose.transform.matrix, FLOAT_EPSILON,
    61             "Grip matrix is not equal to target ray matrix.");
     61            IDENTITY_MATRIX, FLOAT_EPSILON,
     62            "Pointer matrix is not equal to its set value.");
    6263        });
    6364
     
    7475
    7576        t.step( () => {
    76           // When a grip matrix and pointer offset are specified,
    77           // pointer matrix should be grip matrix multiplied with the pointer
    78           // offset.
     77          // Verify that changes to the pointer origin are properly reflected.
    7978          assert_not_equals(grip_pose, null);
    8079          assert_matrix_approx_equals(grip_pose.transform.matrix, VALID_GRIP,
    8180            FLOAT_EPSILON, "Grip matrix is not equal to input valid grip.");
    8281          assert_matrix_approx_equals(input_pose.transform.matrix,
    83             VALID_GRIP_WITH_POINTER_OFFSET, FLOAT_EPSILON,
    84             "Grip matrix not multipled properly.");
     82            VALID_POINTER, FLOAT_EPSILON,
     83            "Pointer matrix not set properly.");
    8584        });
    8685
     
    8988
    9089      // Can only request input poses in an xr frame.
    91       session.requestAnimationFrame(CheckInvalidGrip);
     90      requestSkipAnimationFrame(session, CheckInvalidGrip);
    9291    });
    9392  });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/getViewerPose_emulatedPosition.https.html

    r258499 r265546  
    1717
    1818    let testFunction = function(session, fakeDeviceController, t) {
     19      let debug = xr_debug.bind(this, 'testFunction');
    1920      return session.requestReferenceSpace('local')
    2021        .then((referenceSpace) => new Promise((resolve, reject) => {
     22          debug('refSpace promise');
    2123          function CheckPositionNotEmulated(time, vrFrame){
     24            debug('rAF 1: checkPositionNotEmulated');
    2225            t.step(() => {
    2326              let pose = vrFrame.getViewerPose(referenceSpace);
     
    3134
    3235          function CheckPositionEmulated(time, vrFrame) {
     36            debug('rAF 2: checkPositionEmulated');
    3337            t.step(() => {
    3438              let pose = vrFrame.getViewerPose(referenceSpace);
     
    3842
    3943            // Finished.
     44            debug('resolve');
    4045            resolve();
    4146          }
    4247
    43           session.requestAnimationFrame(CheckPositionNotEmulated);
     48          requestSkipAnimationFrame(session, CheckPositionNotEmulated);
    4449        }));
    4550    };
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html

    r258499 r265546  
    1818// 0.25m above world origin.
    1919const FLOOR_ORIGIN_TRANSFORM = {
    20   position: [0, -0.25, 0],
     20  position: [0, 0.25, 0],
    2121  orientation: [0, 0, 0, 1],
    2222};
     
    2525  supportedModes: ["immersive-ar"],
    2626  views: VALID_VIEWS,
    27   floorOrigin: FLOOR_ORIGIN_TRANSFORM,    // aka floor_from_mojo
     27  floorOrigin: FLOOR_ORIGIN_TRANSFORM,    // aka mojo_from_floor
    2828  viewerOrigin: VIEWER_ORIGIN_TRANSFORM,  // aka mojo_from_viewer
    2929  supportedFeatures: ALL_FEATURES,
     
    6565            for(const [index, expectedPose] of expectedPoses.entries()) {
    6666              const pose = hitTestResults[index].getPose(localRefSpace);
    67               assert_true(pose != null, "Each hit test result should have a pose in viewer space");
     67              assert_true(pose != null, "Each hit test result should have a pose in local space");
    6868              if(expectedPose != null) {
    6969                assert_transform_approx_equals(pose.transform, expectedPose);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html

    r265545 r265546  
    1616};
    1717
     18// Creates a test method that leverages regular hit test API (as opposed to hit
     19// test for transient input).
    1820// |shouldSucceed| - true if the hit test request is expected to succeed, false otherwise
    1921// |endSession| - true if the test case should call session.end() prior to requesting hit test
    20 const testFunctionGenerator = function(shouldSucceed, endSession) {
     22// |expectedError| - expected error name that should be returned in case shouldSucceed is false
     23const testFunctionGeneratorRegular = function(shouldSucceed, endSession, expectedError) {
    2124  const testFunction = function(session, fakeDeviceController, t) {
    2225    session.requestReferenceSpace('viewer').then((viewerRefSpace) => {
     
    4043          assert_false(shouldSucceed,
    4144            "`requestHitTestSource` failed when it was expected to succeed, error: " + error);
     45          assert_equals(error.name, expectedError,
     46            "`requestHitTestSource` failed with unexpected error name");
    4247        });
    4348      });
     
    4954
    5055xr_session_promise_test("Hit test subscription succeeds if the feature was requested",
    51   testFunctionGenerator(/*shouldSucceed=*/true, /*endSession=*/false),
     56  testFunctionGeneratorRegular(/*shouldSucceed=*/true, /*endSession=*/false),
    5257  fakeDeviceInitParams,
    5358  'immersive-ar', { 'requiredFeatures': ['hit-test'] });
    5459
    5560xr_session_promise_test("Hit test subscription fails if the feature was not requested",
    56   testFunctionGenerator(/*shouldSucceed=*/false, /*endSession=*/false),
     61  testFunctionGeneratorRegular(/*shouldSucceed=*/false, /*endSession=*/false, "NotSupportedError"),
    5762  fakeDeviceInitParams,
    5863  'immersive-ar', {});
    5964
    6065xr_session_promise_test("Hit test subscription fails if the feature was requested but the session already ended",
    61   testFunctionGenerator(/*shouldSucceed=*/false, /*endSession=*/true),
     66  testFunctionGeneratorRegular(/*shouldSucceed=*/false, /*endSession=*/true, "InvalidStateError"),
    6267  fakeDeviceInitParams,
    6368  'immersive-ar', { 'requiredFeatures': ['hit-test'] });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/w3c-import.log

    r258499 r265546  
    1515------------------------------------------------------------------------
    1616List of files:
     17/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html
    1718/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_refSpaces.https.html
    18 /LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states.https.html
     19/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html
     20/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html
     21/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html
     22/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/idlharness.https.html
    1923/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/xrRay_constructor.https.html
    2024/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/xrRay_matrix.https.html
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/hit-test/xrRay_constructor.https.html

    r258499 r265546  
    1919    // Check defaults - should be 0,0,0,1 for origin and 0,0,-1,0 for direction,
    2020    // identity matrix for the transform:
    21     let xrRay = new XRRay();
     21    let xrRay1 = new XRRay();
     22    let xrRay2 = new XRRay({});
     23    let xrRay3 = new XRRay({}, {});
     24
    2225    assert_point_approx_equals(
    23       xrRay.origin, {x : 0.0, y : 0.0, z : 0.0, w : 1.0},
     26      xrRay1.origin, {x : 0.0, y : 0.0, z : 0.0, w : 1.0},
    2427      FLOAT_EPSILON, "origin-default:");
    2528    assert_point_approx_equals(
    26       xrRay.direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0},
     29      xrRay1.direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0},
    2730      FLOAT_EPSILON, "direction-default:");
    2831    assert_matrix_approx_equals(
    29       xrRay.matrix, IDENTITY_MATRIX,
     32      xrRay1.matrix, IDENTITY_MATRIX,
    3033      FLOAT_EPSILON, "matrix-default:");
     34
     35    assert_ray_approx_equals(xrRay1, xrRay2, FLOAT_EPSILON, "ray1-ray2-default:");
     36    assert_ray_approx_equals(xrRay2, xrRay3, FLOAT_EPSILON, "ray2-ray3-default:");
    3137  }
    3238
     
    3440    // Check custom value for origin, default for direction:
    3541    let originDict = {x : 11.0, y : 12.0, z : 13.0, w : 1.0};
     42    let xrRay1 = new XRRay(originDict);
    3643    let xrRay2 = new XRRay(DOMPoint.fromPoint(originDict));
    3744    let xrRay3 = new XRRay(DOMPointReadOnly.fromPoint(originDict));
     
    4249
    4350    assert_point_approx_equals(
    44       xrRay2.origin, originDict,
     51      xrRay1.origin, originDict,
    4552      FLOAT_EPSILON, "origin-custom-direction-default:");
    4653    assert_point_approx_equals(
    47       xrRay2.direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0},
     54      xrRay1.direction, {x : 0.0, y : 0.0, z : -1.0, w : 0.0},
    4855      FLOAT_EPSILON, "direction-custom-direction-default:");
    4956    assert_matrix_approx_equals(
    50       xrRay2.matrix, matrix1,
     57      xrRay1.matrix, matrix1,
    5158      FLOAT_EPSILON, "matrix-custom-direction-default:");
    5259
     60    assert_ray_approx_equals(xrRay1, xrRay2, FLOAT_EPSILON, "ray1-ray2-direction-default:");
    5361    assert_ray_approx_equals(xrRay2, xrRay3, FLOAT_EPSILON, "ray2-ray3-direction-default:");
    5462  }
     
    6876                   10, 10, 10,  1];
    6977
     78    let xrRay1 = new XRRay(
     79      originDict,
     80      directionDict);
     81
    7082    let xrRay2 = new XRRay(
    7183      DOMPoint.fromPoint(originDict),
     
    7789
    7890    assert_point_approx_equals(
    79       xrRay2.origin, originDict,
     91      xrRay1.origin, originDict,
    8092      FLOAT_EPSILON, "origin-custom:");
    8193    assert_point_approx_equals(
    82       xrRay2.direction, directionNorm,
     94      xrRay1.direction, directionNorm,
    8395      FLOAT_EPSILON, "direction-custom:");
    8496    assert_matrix_approx_equals(
    85       xrRay2.matrix, matrix1,
     97      xrRay1.matrix, matrix1,
    8698      FLOAT_EPSILON, "matrix-custom:");
    8799
     100    assert_ray_approx_equals(xrRay1, xrRay2, FLOAT_EPSILON, "ray1-ray2:");
    88101    assert_ray_approx_equals(xrRay2, xrRay3, FLOAT_EPSILON, "ray2-ray3:");
    89102  }
     
    92105    // Check that we throw exception on direction too close to 0,0,0:
    93106    let originDict = {x : 10.0, y : 10.0, z : 10.0, w : 1.0};
    94     let directionDict = {x : 0.0, y : 0.0, z : 0.0, w : 0.0};
     107    let directionDict = {x : 1.0, y : 0.0, z : 0.0, w : 0.0};
    95108
    96     try {
    97       let xrRay = new XRRay(
     109    assert_throws_js(TypeError, () => new XRRay(
    98110        DOMPoint.fromPoint(originDict),
    99         DOMPoint.fromPoint(directionDict));
     111        DOMPoint.fromPoint({x : 0.0, y : 0.0, z : 0.0, w : 0.0})
     112    ), "Constructor should throw for zero direction");
    100113
    101       assert(false, "origin-custom-direction-zero:exception not thrown");
    102     }
    103     catch(e)
    104     {
    105       if(e instanceof DOMException) {
    106         assert_equals(e.name, "InvalidStateError", "origin-custom-direction-zero:incorrect DOM exception thrown");
    107       } else {
    108         assert(false, "origin-custom-direction-zero:other exception thrown: " + e);
    109       }
    110     }
     114    assert_throws_js(TypeError, () => new XRRay(
     115        DOMPoint.fromPoint(originDict),
     116        DOMPoint.fromPoint({x : 1.0, y : 0.0, z : 0.0, w : 0.5})
     117    ), "Constructor should throw for nonzero direction w coordinate");
     118
     119    assert_throws_js(TypeError, () => new XRRay(
     120        DOMPoint.fromPoint({x : 10.0, y : 10.0, z : 10.0, w : 0.5}),
     121        DOMPoint.fromPoint(directionDict)
     122    ), "Constructor should throw for non-1 origin w coordinate");
    111123  }
    112124
     
    125137                   10.,    10,  10.,      1];
    126138
    127     let xrRay4 = new XRRay(
     139    let xrRay = new XRRay(
    128140      new XRRigidTransform(
    129141        DOMPoint.fromPoint(originDict),
     
    131143
    132144    assert_point_approx_equals(
    133       xrRay4.origin, originDict,
     145      xrRay.origin, originDict,
    134146      FLOAT_EPSILON, "origin-custom-rigid:");
    135147    assert_point_approx_equals(
    136       xrRay4.direction, directionNorm2,
     148      xrRay.direction, directionNorm2,
    137149      FLOAT_EPSILON, "direction-custom-rigid:");
    138150
    139151    assert_matrix_approx_equals(
    140       xrRay4.matrix, matrix2,
     152      xrRay.matrix, matrix2,
    141153      FLOAT_EPSILON, "matrix-custom-rigid:");
    142154  }
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/idlharness.https.window-expected.txt

    r265239 r265546  
    5151PASS XRSession interface: attribute onsqueezeend
    5252PASS XRSession interface: attribute onvisibilitychange
     53PASS XRSession must be primary interface of xrSession
     54PASS Stringification of xrSession
     55PASS XRSession interface: xrSession must inherit property "visibilityState" with the proper type
     56PASS XRSession interface: xrSession must inherit property "renderState" with the proper type
     57PASS XRSession interface: xrSession must inherit property "inputSources" with the proper type
     58PASS XRSession interface: xrSession must inherit property "updateRenderState(optional XRRenderStateInit)" with the proper type
     59PASS XRSession interface: calling updateRenderState(optional XRRenderStateInit) on xrSession with too few arguments must throw TypeError
     60PASS XRSession interface: xrSession must inherit property "requestReferenceSpace(XRReferenceSpaceType)" with the proper type
     61PASS XRSession interface: calling requestReferenceSpace(XRReferenceSpaceType) on xrSession with too few arguments must throw TypeError
     62PASS XRSession interface: xrSession must inherit property "requestAnimationFrame(XRFrameRequestCallback)" with the proper type
     63PASS XRSession interface: calling requestAnimationFrame(XRFrameRequestCallback) on xrSession with too few arguments must throw TypeError
     64PASS XRSession interface: xrSession must inherit property "cancelAnimationFrame(unsigned long)" with the proper type
     65PASS XRSession interface: calling cancelAnimationFrame(unsigned long) on xrSession with too few arguments must throw TypeError
     66PASS XRSession interface: xrSession must inherit property "end()" with the proper type
     67PASS XRSession interface: xrSession must inherit property "onend" with the proper type
     68PASS XRSession interface: xrSession must inherit property "oninputsourceschange" with the proper type
     69PASS XRSession interface: xrSession must inherit property "onselect" with the proper type
     70PASS XRSession interface: xrSession must inherit property "onselectstart" with the proper type
     71PASS XRSession interface: xrSession must inherit property "onselectend" with the proper type
     72PASS XRSession interface: xrSession must inherit property "onsqueeze" with the proper type
     73PASS XRSession interface: xrSession must inherit property "onsqueezestart" with the proper type
     74PASS XRSession interface: xrSession must inherit property "onsqueezeend" with the proper type
     75PASS XRSession interface: xrSession must inherit property "onvisibilitychange" with the proper type
    5376PASS XRRenderState interface: existence and properties of interface object
    5477PASS XRRenderState interface object length
     
    6184PASS XRRenderState interface: attribute inlineVerticalFieldOfView
    6285PASS XRRenderState interface: attribute baseLayer
     86PASS XRRenderState must be primary interface of xrRenderState
     87PASS Stringification of xrRenderState
     88PASS XRRenderState interface: xrRenderState must inherit property "depthNear" with the proper type
     89PASS XRRenderState interface: xrRenderState must inherit property "depthFar" with the proper type
     90PASS XRRenderState interface: xrRenderState must inherit property "inlineVerticalFieldOfView" with the proper type
     91PASS XRRenderState interface: xrRenderState must inherit property "baseLayer" with the proper type
    6392PASS XRFrame interface: existence and properties of interface object
    6493PASS XRFrame interface object length
     
    84113PASS XRReferenceSpace interface: operation getOffsetReferenceSpace(XRRigidTransform)
    85114PASS XRReferenceSpace interface: attribute onreset
     115PASS XRReferenceSpace must be primary interface of xrReferenceSpace
     116PASS Stringification of xrReferenceSpace
     117PASS XRReferenceSpace interface: xrReferenceSpace must inherit property "getOffsetReferenceSpace(XRRigidTransform)" with the proper type
     118PASS XRReferenceSpace interface: calling getOffsetReferenceSpace(XRRigidTransform) on xrReferenceSpace with too few arguments must throw TypeError
     119PASS XRReferenceSpace interface: xrReferenceSpace must inherit property "onreset" with the proper type
    86120PASS XRBoundedReferenceSpace interface: existence and properties of interface object
    87121PASS XRBoundedReferenceSpace interface object length
     
    120154PASS XRRigidTransform interface: attribute matrix
    121155PASS XRRigidTransform interface: attribute inverse
     156PASS XRRigidTransform must be primary interface of new XRRigidTransform()
     157PASS Stringification of new XRRigidTransform()
     158PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "position" with the proper type
     159PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "orientation" with the proper type
     160PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "matrix" with the proper type
     161PASS XRRigidTransform interface: new XRRigidTransform() must inherit property "inverse" with the proper type
    122162PASS XRPose interface: existence and properties of interface object
    123163PASS XRPose interface object length
     
    154194PASS XRInputSourceArray interface: iterable<XRInputSource>
    155195PASS XRInputSourceArray interface: attribute length
     196PASS XRInputSourceArray must be primary interface of xrInputSourceArray
     197PASS Stringification of xrInputSourceArray
     198PASS XRInputSourceArray interface: xrInputSourceArray must inherit property "length" with the proper type
    156199PASS XRLayer interface: existence and properties of interface object
    157200PASS XRLayer interface object length
     
    173216PASS XRWebGLLayer interface: operation getViewport(XRView)
    174217PASS XRWebGLLayer interface: operation getNativeFramebufferScaleFactor(XRSession)
     218PASS XRWebGLLayer must be primary interface of xrWebGLLayer
     219PASS Stringification of xrWebGLLayer
     220PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "antialias" with the proper type
     221PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "ignoreDepthValues" with the proper type
     222PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "framebuffer" with the proper type
     223PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "framebufferWidth" with the proper type
     224PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "framebufferHeight" with the proper type
     225PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "getViewport(XRView)" with the proper type
     226PASS XRWebGLLayer interface: calling getViewport(XRView) on xrWebGLLayer with too few arguments must throw TypeError
     227PASS XRWebGLLayer interface: xrWebGLLayer must inherit property "getNativeFramebufferScaleFactor(XRSession)" with the proper type
     228PASS XRWebGLLayer interface: calling getNativeFramebufferScaleFactor(XRSession) on xrWebGLLayer with too few arguments must throw TypeError
    175229PASS XRSessionEvent interface: existence and properties of interface object
    176230PASS XRSessionEvent interface object length
     
    180234PASS XRSessionEvent interface: existence and properties of interface prototype object's @@unscopables property
    181235PASS XRSessionEvent interface: attribute session
     236PASS XRSessionEvent must be primary interface of xrSessionEvent
     237PASS Stringification of xrSessionEvent
     238PASS XRSessionEvent interface: xrSessionEvent must inherit property "session" with the proper type
    182239PASS XRInputSourceEvent interface: existence and properties of interface object
    183240PASS XRInputSourceEvent interface object length
     
    197254PASS XRInputSourcesChangeEvent interface: attribute added
    198255PASS XRInputSourcesChangeEvent interface: attribute removed
     256PASS XRInputSourcesChangeEvent must be primary interface of xrInputSourcesChangeEvent
     257PASS Stringification of xrInputSourcesChangeEvent
     258PASS XRInputSourcesChangeEvent interface: xrInputSourcesChangeEvent must inherit property "session" with the proper type
     259PASS XRInputSourcesChangeEvent interface: xrInputSourcesChangeEvent must inherit property "added" with the proper type
     260PASS XRInputSourcesChangeEvent interface: xrInputSourcesChangeEvent must inherit property "removed" with the proper type
    199261PASS XRReferenceSpaceEvent interface: existence and properties of interface object
    200262PASS XRReferenceSpaceEvent interface object length
     
    212274FAIL XRPermissionStatus interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "XRPermissionStatus" expected property "XRPermissionStatus" missing
    213275FAIL XRPermissionStatus interface: attribute granted assert_own_property: self does not have own property "XRPermissionStatus" expected property "XRPermissionStatus" missing
     276PASS WebGLRenderingContextBase interface: webGLRenderingContextBase must inherit property "makeXRCompatible()" with the proper type
    214277PASS Navigator interface: attribute xr
    215278PASS Navigator interface: navigator must inherit property "xr" with the proper type
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/idlharness.https.window.js

    r258499 r265546  
    11// META: script=/resources/WebIDLParser.js
    22// META: script=/resources/idlharness.js
     3// META: timeout=long
    34
    45'use strict';
     
    89idl_test(
    910  ['webxr'],
    10   ['permissions', 'webgl1', 'html', 'dom'],
     11  ['permissions', 'webgl1', 'geometry', 'html', 'dom'],
    1112  async idl_array => {
    1213    idl_array.add_objects({
    1314      Navigator: ['navigator'],
    1415      XR: ['navigator.xr'],
     16      // TODO: XRSystem
     17      XRSession: ['xrSession'],
     18      XRRenderState: ['xrRenderState'],
     19      // TODO: XRFrame
     20      // TODO: XRSpace
     21      XRReferenceSpace: ['xrReferenceSpace'],
     22      // TODO: XRBoundedReferenceSpace
     23      // TODO: XRView
     24      // TODO: XRViewport
     25      XRRigidTransform: ['new XRRigidTransform()'],
     26      // TODO: XRPose
     27      // TODO: XRViewerPose
     28      // TODO: XRInputSource
     29      XRInputSourceArray: ['xrInputSourceArray'],
     30      XRWebGLLayer: ['xrWebGLLayer'],
     31      WebGLRenderingContextBase: ['webGLRenderingContextBase'],
     32      XRSessionEvent: ['xrSessionEvent'],
     33      // TODO: XRInputSourceEvent
     34      XRInputSourcesChangeEvent: ['xrInputSourcesChangeEvent'],
     35      // TODO: XRReferenceSpaceEvent
     36      // TODO: XRPermissionStatus
    1537    });
     38
     39    self.xrSession = await navigator.xr.requestSession('inline');
     40    self.xrRenderState = self.xrSession.renderState;
     41    self.xrReferenceSpace = await self.xrSession.requestReferenceSpace('viewer');
     42    self.xrInputSourceArray = self.xrSession.inputSources;
     43    self.xrSessionEvent = new XRSessionEvent('end', {session: self.xrSession});
     44    self.xrInputSourcesChangeEvent = new XRInputSourcesChangeEvent('inputsourceschange', {
     45      session: self.xrSession,
     46      added: [],
     47      removed: [],
     48    });
     49
     50    // XRWebGLRenderingContext is a typedef to either WebGLRenderingContext or WebGL2RenderingContext.
     51    const canvas = document.createElement('canvas');
     52    self.webGLRenderingContextBase = canvas.getContext('webgl');
     53    self.xrWebGLLayer = new XRWebGLLayer(self.xrSession, self.webGLRenderingContextBase);
    1654  }
    1755);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js

    r260936 r265546  
    4949
    5050// A valid input pointer offset for  when we don't care about specific values
    51 const VALID_POINTER_OFFSET = [1, 0, 0, 0,
    52                               0, 1, 0, 0,
    53                               0, 0, 1, 0,
    54                               0, 0, 1, 1];
     51const VALID_POINTER = [1, 0, 0, 0,
     52                       0, 1, 0, 0,
     53                       0, 0, 1, 0,
     54                       0, 0, 1, 1];
    5555
    5656const VALID_POINTER_TRANSFORM = {
     
    5858    orientation: [0, 0, 0, 1]
    5959};
    60 
    61 const VALID_GRIP_WITH_POINTER_OFFSET = [1, 0, 0, 0,
    62                                         0, 1, 0, 0,
    63                                         0, 0, 1, 0,
    64                                         4, 3, 3, 1];
    6560
    6661// A Valid Local to floor matrix/transform for when we don't care about specific
     
    130125  'dom-overlay',
    131126  'light-estimation',
     127  'anchors',
    132128];
    133129
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js

    r260936 r265546  
     1'use strict';
     2
    13// These tests rely on the User Agent providing an implementation of the
    24// WebXR Testing API (https://github.com/immersive-web/webxr-test-api).
     
    1012// Debugging message helper, by default does nothing. Implementations can
    1113// override this.
    12 var xr_debug = function(name, msg) {}
    13 var isChromiumBased = 'MojoInterfaceInterceptor' in self;
    14 var isWebKitBased = 'internals' in self && 'xrTest' in internals;
     14var xr_debug = function(name, msg) {};
    1515
    1616function xr_promise_test(name, func, properties) {
     
    1919    xr_debug(name, 'setup');
    2020
    21     if (isChromiumBased) {
    22       // Chrome setup
    23       await loadChromiumResources;
    24       xr_debug = navigator.xr.test.Debug;
     21    // Only set up once.
     22    if (!navigator.xr.test) {
     23      // Load test-only API helpers.
     24      const script = document.createElement('script');
     25      script.src = '/resources/test-only-api.js';
     26      script.async = false;
     27      const p = new Promise((resolve, reject) => {
     28        script.onload = () => { resolve(); };
     29        script.onerror = e => { reject(e); };
     30      })
     31      document.head.appendChild(script);
     32      await p;
     33
     34      if (isChromiumBased) {
     35        // Chrome setup
     36        await loadChromiumResources();
     37      } else if (isWebKitBased) {
     38        // WebKit setup
     39        await setupWebKitWebXRTestAPI();
     40      } else {
     41        assert_implements(false, "missing navigator.xr.test");
     42      }
    2543    }
    2644
    27     if (isWebKitBased) {
    28       // WebKit setup
    29       await setupWebKitWebXRTestAPI;
     45    // Either the test api needs to be polyfilled and it's not set up above, or
     46    // something happened to one of the known polyfills and it failed to be
     47    // setup properly. Either way, the fact that xr_promise_test is being used
     48    // means that the tests expect navigator.xr.test to be set. By rejecting now
     49    // we can hopefully provide a clearer indication of what went wrong.
     50    if (!navigator.xr.test) {
     51      // We can't use assert_true here because it causes the wpt testharness
     52      // to treat this as a test page and not as a test.
     53      return Promise.reject("No navigator.xr.test object found, even after attempted load");
    3054    }
    3155
     
    4367    return func(t);
    4468  }, name, properties);
     69}
     70
     71// A utility function for waiting one animation frame before running the callback
     72//
     73// This is only needed after calling FakeXRDevice methods outside of an animation frame
     74//
     75// This is so that we can paper over the potential race allowed by the "next animation frame"
     76// concept https://immersive-web.github.io/webxr-test-api/#xrsession-next-animation-frame
     77function requestSkipAnimationFrame(session, callback) {
     78 session.requestAnimationFrame(() => {
     79  session.requestAnimationFrame(callback);
     80 });
    4581}
    4682
     
    150186  callback(window.XRPresentationContext, 'XRPresentationContext');
    151187  callback(window.XRFrame, 'XRFrame');
     188  callback(window.XRLayer, 'XRLayer');
    152189  callback(window.XRView, 'XRView');
    153190  callback(window.XRViewport, 'XRViewport');
     
    163200
    164201// Code for loading test API in Chromium.
    165 let loadChromiumResources = Promise.resolve().then(() => {
    166   if (!isChromiumBased) {
    167     // Do nothing on non-Chromium-based browsers or when the Mojo bindings are
    168     // not present in the global namespace.
    169     return;
    170   }
    171 
     202async function loadChromiumResources() {
    172203  let chromiumResources = [
    173     '/gen/layout_test_data/mojo/public/js/mojo_bindings.js',
    174204    '/gen/mojo/public/mojom/base/time.mojom.js',
     205    '/gen/mojo/public/mojom/base/shared_memory.mojom.js',
     206    '/gen/mojo/public/mojom/base/unguessable_token.mojom.js',
     207    '/gen/gpu/ipc/common/sync_token.mojom.js',
     208    '/gen/gpu/ipc/common/mailbox.mojom.js',
    175209    '/gen/gpu/ipc/common/mailbox_holder.mojom.js',
    176     '/gen/gpu/ipc/common/sync_token.mojom.js',
    177     '/gen/ui/display/mojom/display.mojom.js',
    178210    '/gen/ui/gfx/geometry/mojom/geometry.mojom.js',
     211    '/gen/ui/gfx/mojom/native_handle_types.mojom.js',
     212    '/gen/ui/gfx/mojom/buffer_types.mojom.js',
     213    '/gen/ui/gfx/mojom/color_space.mojom.js',
     214    '/gen/ui/gfx/mojom/display_color_spaces.mojom.js',
    179215    '/gen/ui/gfx/mojom/gpu_fence_handle.mojom.js',
    180216    '/gen/ui/gfx/mojom/transform.mojom.js',
     217    '/gen/ui/display/mojom/display.mojom.js',
     218    '/gen/device/gamepad/public/mojom/gamepad.mojom.js',
    181219    '/gen/device/vr/public/mojom/vr_service.mojom.js',
    182220    '/resources/chromium/webxr-test-math-helper.js',
    183221    '/resources/chromium/webxr-test.js',
     222    // Required only by resources/chromium/webxr-test.js
    184223    '/resources/testdriver.js',
    185224    '/resources/testdriver-vendor.js',
     
    194233  }
    195234
    196   let chain = Promise.resolve();
    197     chromiumResources.forEach(path => {
    198       let script = document.createElement('script');
    199       script.src = path;
    200       script.async = false;
    201       chain = chain.then(() => new Promise(resolve => {
    202                            script.onload = () => resolve();
    203                          }));
    204       document.head.appendChild(script);
    205   });
    206 
    207   return chain;
    208 });
    209 
    210 let setupWebKitWebXRTestAPI = Promise.resolve().then(() => {
    211   if (!isWebKitBased) {
    212     // Do nothing on non-WebKit-based browsers.
    213     return;
    214   }
    215 
     235  await loadMojoResources(chromiumResources);
     236
     237  xr_debug = navigator.xr.test.Debug;
     238}
     239
     240function setupWebKitWebXRTestAPI() {
    216241  // WebKit setup. The internals object is used by the WebKit test runner
    217242  // to provide JS access to internal APIs. In this case it's used to
     
    219244  navigator.xr.test = internals.xrTest;
    220245  return Promise.resolve();
    221 });
     246}
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/w3c-import.log

    r258499 r265546  
    2929/LayoutTests/imported/w3c/web-platform-tests/webxr/idlharness.https.window.js
    3030/LayoutTests/imported/w3c/web-platform-tests/webxr/navigator_xr_sameObject.https.html
     31/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_update.https.html
    3132/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html
    3233/LayoutTests/imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_inline.https.html
    3334/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html
    3435/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html
     36/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html
    3537/LayoutTests/imported/w3c/web-platform-tests/webxr/webxr-supported-by-feature-policy.html
    3638/LayoutTests/imported/w3c/web-platform-tests/webxr/webxr_availability.http.sub.html
     
    6163/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html
    6264/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset_viewer.https.html
     65/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html
    6366/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_constructor.https.html
    6467/LayoutTests/imported/w3c/web-platform-tests/webxr/xrRigidTransform_inverse.https.html
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html

    r258499 r265546  
    99    xr_promise_test("An XR-compatible webglCanvasContext can be created",
    1010      (t) => {
     11        let gl = null;
     12        let offscreenGl = null;
    1113        return navigator.xr.test.simulateDeviceConnection(TRACKED_IMMERSIVE_DEVICE)
    1214          .then( (controller) => {
    13             webglCanvas = document.getElementById('webgl-canvas');
    14             gl = webglCanvas.getContext('webgl', {xrCompatible: true});
     15            let webglCanvas = document.getElementById('webgl-canvas');
     16            gl = webglCanvas.getContext('webgl');
     17            return gl.makeXRCompatible();
     18          }).then( () => {
    1519            assert_true(gl.getContextAttributes().xrCompatible);
    1620
    1721            // Check that an offscreen context behaves no different.
    18             let offscreenCanvas = document.createElement('canvas');
    19             let offscreenGl = webglCanvas.getContext(
    20               'webgl', {xrCompatible: true});
    21             assert_true(offscreenGl.getContextAttributes().xrCompatible);
     22            //let offscreenCanvas = document.createElement('canvas');
     23            //offscreenGl = offscreenCanvas.getContext('webgl');
     24            //return offscreenGl.makeXRCompatible();
     25          }).then( () => {
     26            //assert_true(offscreenGl.getContextAttributes().xrCompatible);
    2227          });
    2328      });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html

    r258499 r265546  
    1414        .then( (controller) => {
    1515          webglCanvas = document.getElementById('webgl-canvas');
    16           gl = webglCanvas.getContext('webgl', {xrCompatible: true});
     16          gl = webglCanvas.getContext('webgl');
     17          return gl.makeXRCompatible();
     18        }).then( () => {
    1719          gl.getExtension('WEBGL_lose_context').loseContext();
    1820          return promise_rejects_dom(t, 'InvalidStateError', gl.makeXRCompatible());
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrBoundedReferenceSpace_updates.https.html

    r258499 r265546  
    5050          // Now set the bounds explicitly and check again on the next frame.
    5151          fakeDeviceController.setBoundsGeometry(VALID_BOUNDS);
    52           session.requestAnimationFrame(onFrame);
     52          requestSkipAnimationFrame(session, onFrame);
    5353        });
    5454    });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_add_remove.https.html

    r258499 r265546  
    2222    let input_source_1 = fakeDeviceController.simulateInputSourceConnection(RIGHT_CONTROLLER);
    2323
    24     session.requestAnimationFrame((time, xrFrame) => {
     24    requestSkipAnimationFrame(session, (time, xrFrame) => {
    2525      let input_sources = session.inputSources;
    2626
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_emulatedPosition.https.html

    r258499 r265546  
    5454
    5555      // Can only request input poses in an xr frame.
    56       session.requestAnimationFrame(CheckPositionNotEmulated);
     56      requestSkipAnimationFrame(session, CheckPositionNotEmulated);
    5757    });
    5858  });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_profiles.https.html

    r258499 r265546  
    2323  // are requesting an animation frame before checking the profiles list.
    2424  return new Promise((resolve) => {
    25     session.requestAnimationFrame(() => {
     25    requestSkipAnimationFrame(session, () => {
    2626      let profiles = session.inputSources[0].profiles;
    2727      t.step(() => {
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrInputSource_sameObject.https.html

    r258499 r265546  
    1919    });
    2020
    21     session.requestAnimationFrame((time, xrFrame) => {
     21    requestSkipAnimationFrame(session, (time, xrFrame) => {
    2222      let source = session.inputSources[0];
    2323      let targetRaySpace = source.targetRaySpace;
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrPose_transform_sameObject.https.html

    r258499 r265546  
    2020
    2121    session.requestReferenceSpace('local').then((referenceSpace) => {
    22       session.requestAnimationFrame((time, xrFrame) => {
     22      requestSkipAnimationFrame(session, (time, xrFrame) => {
    2323        let source = session.inputSources[0];
    2424        let input_pose = xrFrame.getPose(source.targetRaySpace, referenceSpace);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffset.https.html

    r258499 r265546  
    4343
    4444    const POINTER_TRANSFORM_WITH_ROTATION = {
    45       position: [2, 0, 1],
    46       orientation: [0, 0, 0.7071, 0.7071]
     45      position: [0, 1, 4],
     46      orientation: [-0.5, 0.5, 0.5, -0.5]
    4747    };
    4848
     
    7575        let source = session.inputSources[0];
    7676
    77         function CheckState(referenceSpace, expected_view_matrix, expected_grip_matrix, expected_ray_matrix) {
     77        function CheckState(referenceSpace, expected_view_matrix, expected_grip_matrix, expected_ray_matrix, prefix) {
    7878          t.step(() => {
    7979            let pose = frame.getViewerPose(referenceSpace);
     
    8585            let ray_matrix = input_pose.transform.matrix;
    8686
    87             assert_matrix_approx_equals(view_matrix, expected_view_matrix);
    88             assert_matrix_approx_equals(grip_matrix, expected_grip_matrix);
    89             assert_matrix_approx_equals(ray_matrix, expected_ray_matrix);
     87            assert_matrix_approx_equals(view_matrix, expected_view_matrix, prefix + " view matrix");
     88            assert_matrix_approx_equals(grip_matrix, expected_grip_matrix, prefix + " grip matrix");
     89            assert_matrix_approx_equals(ray_matrix, expected_ray_matrix, prefix + " ray matrix");
    9090          });
    9191        }
    9292
    93         CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_1, EXPECTED_GRIP_MATRIX_1, EXPECTED_RAY_MATRIX_1);
     93        CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_1, EXPECTED_GRIP_MATRIX_1, EXPECTED_RAY_MATRIX_1, "Initial");
    9494
    9595        const new_position1 = {
     
    106106
    107107        referenceSpace = referenceSpace.getOffsetReferenceSpace(new XRRigidTransform(new_position1, new_orientation1));
    108         CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_2, EXPECTED_GRIP_MATRIX_2, EXPECTED_RAY_MATRIX_2);
     108        CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_2, EXPECTED_GRIP_MATRIX_2, EXPECTED_RAY_MATRIX_2, "First transform");
    109109
    110110        const new_position2 = {
     
    121121
    122122        referenceSpace = referenceSpace.getOffsetReferenceSpace(new XRRigidTransform(new_position2, new_orientation2));
    123         CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_3, EXPECTED_GRIP_MATRIX_3, EXPECTED_RAY_MATRIX_3);
     123        CheckState(referenceSpace, EXPECTED_VIEW_MATRIX_3, EXPECTED_GRIP_MATRIX_3, EXPECTED_RAY_MATRIX_3, "Second transform");
    124124
    125125        resolve();
     
    127127
    128128      // Can only request input poses in an xr frame.
    129       session.requestAnimationFrame(OnFrame);
     129      requestSkipAnimationFrame(session, OnFrame);
    130130    });
    131131  });
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https.html

    r258499 r265546  
    2929
    3030const FLOOR_TRANSFORM = {
    31   position: [0.1, 0.2, 0.3],
     31  position: [-0.1, -0.2, -0.3],
    3232  orientation: [0, 0, 0, 1]
    3333};
     
    5555
    5656  const LOCAL_POINTER_TRANSFORM = {
    57     position: [0.01, 0.02, 0.03],
     57    position: [1.01, 2.02, 3.03],
    5858    orientation: [0, 0, 0, 1]
    5959  }
     
    6868
    6969  return new Promise((resolve, reject) => {
    70     session.requestAnimationFrame((time, frame) => {
     70    requestSkipAnimationFrame(session, (time, frame) => {
    7171      let input_source = session.inputSources[0];
    7272
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_input_events_end.https.html

    r258499 r265546  
    4343      selectionClicked: true
    4444    });
    45     session.requestAnimationFrame(() => {});
     45    requestSkipAnimationFrame(session, () => {});
    4646  }
    4747
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html

    r258499 r265546  
    2222      let frameTime = 0;
    2323      let lastFrameTime = 0;
     24
    2425      let firstFrame = true;
    2526
     
    2728        lastFrameTime = frameTime;
    2829        frameTime = time;
    29         firstFrame = false;
    3030        let now = performance.now();
    3131
    3232        t.step( () => {
    33           // This callback must be the first one called.
    34           assert_equals(counter, 0);
    35 
    36           if (!firstFrame) {
     33          if(firstFrame) {
     34            // This callback must be the first one called.
     35            assert_equals(counter, 0);
     36          } else {
     37            // If it's a second animation frame, the timestamp must be greater
     38            // than the timestamp on a previous frame.
    3739            assert_greater_than(frameTime, lastFrameTime);
     40            // ... but not grater than 10 seconds.
    3841            assert_approx_equals(frameTime, lastFrameTime, TEN_SECONDS);
    3942          }
     
    4750
    4851        if (firstFrame) {
     52          // We also want this method to run for the second animation frame.
    4953          session.requestAnimationFrame(onFrameFirst);
    5054        } else {
     
    5256        }
    5357
     58        firstFrame = false;
    5459        counter++;
    5560      }
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_sameObject.https.html

    r258499 r265546  
    1919    });
    2020
    21     session.requestAnimationFrame((time, xrFrame) => {
     21    requestSkipAnimationFrame(session, (time, xrFrame) => {
    2222      let renderState = session.renderState;
    2323      let sources = session.inputSources;
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_visibilityState.https.html

    r258499 r265546  
    1717let testFunction = function(session, fakeDeviceController, t) {
    1818  let eventWatcher = new EventWatcher(
    19     t, session, ["visibilitychange", "visibilitychange", "framefired", "watcherdone"]);
     19    t, session, ["visibilitychange", "framefired", "watcherdone"]);
    2020  let eventPromise = eventWatcher.wait_for(
    2121    ["visibilitychange", "visibilitychange", "framefired", "watcherdone"]);
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https.html

    r258499 r265546  
    3737          // Need to request one animation frame for the new stage transform to
    3838          // propagate before we check that it's what we expect.
    39           session.requestAnimationFrame(() => {
    40             session.requestAnimationFrame(onFrame);
    41           });
     39          requestSkipAnimationFrame(session, onFrame);
    4240        });
    4341      }
     
    5957      // Need to wait one frame for the removal to propagate before we check that
    6058      // everything is at the expected emulated position.
    61       session.requestAnimationFrame(() => {
    62         session.requestAnimationFrame(onFirstFrame);
    63       });
     59      requestSkipAnimationFrame(session, onFirstFrame);
    6460    }));
    6561};
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html

    r258499 r265546  
    3030      return new Promise((resolve) => {
    3131        navigator.xr.test.simulateUserActivation(() => {
     32          let xrSession = null;
    3233          navigator.xr.requestSession('immersive-vr')
    3334          .then((session) => {
     35            xrSession = session;
    3436            t.step_func(() => {
    3537              try {
    36                 let webglLayerIncompatible = new XRWebGLLayer(session, gl);
     38                let webglLayerIncompatible = new XRWebGLLayer(xrSession, gl);
    3739                assert_unreached("XRWebGLLayer should fail when created with a context that is not XRCompatible")
    3840              } catch (err) {
     
    4143            })
    4244
    43             gl.makeXRCompatible();
    44 
     45            return gl.makeXRCompatible();
     46          }).then(() => {
    4547            try {
    46               let webglLayerGood = new XRWebGLLayer(session, gl);
     48              let webglLayerGood = new XRWebGLLayer(xrSession, gl);
    4749            } catch (err) {
    4850              reject("XRWebGLLayer should not fail with valid arguments");
     
    5557
    5658              try {
    57                 let webglLayerBadContext = new XRWebGLLayer(session, gl);
     59                let webglLayerBadContext = new XRWebGLLayer(xrSession, gl);
    5860                reject("XRWebGLLayer should fail when created with a lost context");
    5961              } catch (err) {
     
    6466
    6567            webglCanvas.addEventListener('webglcontextrestored', (ev) => {
    66               resolve(session.end().then(() => {
     68              resolve(xrSession.end().then(() => {
    6769                try {
    68                   let webglLayerBadSession = new XRWebGLLayer(session, gl);
     70                  let webglLayerBadSession = new XRWebGLLayer(xrSession, gl);
    6971                  assert_unreached("XRWebGLLayer should fail when created with an ended session");
    7072                } catch (err) {
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r265486 r265546  
    895895# WebXR
    896896webkit.org/b/212897 imported/w3c/web-platform-tests/webxr/idlharness.https.window.html [ Pass ]
    897 webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/webGLCanvasContext_create_xrcompatible.https.html [ Pass ]
    898897webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_contextlost.https.html [ Pass ]
    899898webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/xrDevice_isSessionSupported_inline.https.html [ Pass ]
  • trunk/Source/WebCore/ChangeLog

    r265545 r265546  
     12020-08-06  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [WebXR] Update WebXR WPT directory
     4        https://bugs.webkit.org/show_bug.cgi?id=215224
     5
     6        Reviewed by Youenn Fablet.
     7
     8        The update of the WebXR WPT directory helped us to unveil a couple of mistakes in the current code.
     9        First of all the Events defined in the WebXR spec had to be iso allocated as the Event base class.
     10        Secondly the WebXRInputSourceArray must have a ::create() method. Finally the m_inputSources attribute
     11        of the WebXRSession must be a Ref instead of a RefPtr because the specs mention that the initial
     12        value is an empty array.
     13
     14        Tests: imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html
     15               imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html
     16               imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html
     17               imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html
     18               imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html
     19               imported/w3c/web-platform-tests/webxr/anchors/idlharness.https.window.html
     20               imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html
     21               imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.html
     22               imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html
     23               imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html
     24               imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html
     25               imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html
     26               imported/w3c/web-platform-tests/webxr/hit-test/idlharness.https.html
     27               imported/w3c/web-platform-tests/webxr/render_state_update.https.html
     28               imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html
     29               imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html
     30
     31        * Modules/webxr/WebXRInputSourceArray.cpp:
     32        (WebCore::WebXRInputSourceArray::create): Added.
     33        * Modules/webxr/WebXRInputSourceArray.h:
     34        * Modules/webxr/WebXRSession.cpp:
     35        (WebCore::WebXRSession::WebXRSession): Initialize the m_inputSources.
     36        (WebCore::WebXRSession::inputSources const): Return a const reference.
     37        * Modules/webxr/WebXRSession.h:
     38        * Modules/webxr/XRInputSourcesChangeEvent.cpp: Make it iso allocated.
     39        * Modules/webxr/XRInputSourcesChangeEvent.h: Ditto.
     40        * Modules/webxr/XRSessionEvent.cpp: Ditto.
     41        * Modules/webxr/XRSessionEvent.h: Ditto.
     42
    1432020-08-12  Antti Koivisto  <antti@apple.com>
    244
  • trunk/Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp

    r258498 r265546  
    3030
    3131#include <wtf/IsoMallocInlines.h>
     32#include <wtf/Ref.h>
    3233
    3334namespace WebCore {
  • trunk/Source/WebCore/Modules/webxr/WebXRInputSourceArray.h

    r261863 r265546  
    3838    WTF_MAKE_ISO_ALLOCATED(WebXRInputSourceArray);
    3939public:
     40    static Ref<WebXRInputSourceArray> create() { return adoptRef(*new WebXRInputSourceArray()); }
     41    ~WebXRInputSourceArray() = default;
     42
    4043    unsigned length() const;
    4144    WebXRInputSource* item(unsigned) const;
    4245
    4346private:
    44     WebXRInputSourceArray();
     47    WebXRInputSourceArray() = default;
    4548};
    4649
  • trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp

    r265137 r265546  
    4747WebXRSession::WebXRSession(Document& document, WebXRSystem& system, XRSessionMode mode, PlatformXR::Device& device)
    4848    : ActiveDOMObject(&document)
     49    , m_inputSources(WebXRInputSourceArray::create())
    4950    , m_xrSystem(system)
    5051    , m_mode(mode)
     
    8283const WebXRInputSourceArray& WebXRSession::inputSources() const
    8384{
    84     return *m_inputSources;
     85    return m_inputSources;
    8586}
    8687
  • trunk/Source/WebCore/Modules/webxr/WebXRSession.h

    r264215 r265546  
    110110    XRInteractionMode m_interactionMode;
    111111    XRVisibilityState m_visibilityState;
    112     RefPtr<WebXRInputSourceArray> m_inputSources;
     112    Ref<WebXRInputSourceArray> m_inputSources;
    113113    bool m_ended { false };
    114114
  • trunk/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.cpp

    r258498 r265546  
    3131#include "WebXRInputSource.h"
    3232#include "WebXRSession.h"
     33#include <wtf/IsoMallocInlines.h>
    3334
    3435namespace WebCore {
     36
     37WTF_MAKE_ISO_ALLOCATED_IMPL(XRInputSourcesChangeEvent);
    3538
    3639Ref<XRInputSourcesChangeEvent> XRInputSourcesChangeEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
  • trunk/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.h

    r258498 r265546  
    3838
    3939class XRInputSourcesChangeEvent final : public Event {
     40    WTF_MAKE_ISO_ALLOCATED(XRInputSourcesChangeEvent);
    4041public:
    4142    struct Init : EventInit {
  • trunk/Source/WebCore/Modules/webxr/XRSessionEvent.cpp

    r258498 r265546  
    2929#if ENABLE(WEBXR)
    3030
     31#include <wtf/IsoMallocInlines.h>
    3132#include "WebXRSession.h"
    3233
    3334namespace WebCore {
     35
     36WTF_MAKE_ISO_ALLOCATED_IMPL(XRSessionEvent);
    3437
    3538Ref<XRSessionEvent> XRSessionEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
  • trunk/Source/WebCore/Modules/webxr/XRSessionEvent.h

    r258498 r265546  
    3535
    3636class XRSessionEvent final : public Event {
     37    WTF_MAKE_ISO_ALLOCATED(XRSessionEvent);
    3738public:
    3839    struct Init : EventInit {
Note: See TracChangeset for help on using the changeset viewer.