Bug 1381645 - Part 4: Update web-platform tests to check WebVR interfaces only with HTTPS draft
authorKearwood "Kip" Gilbert <kgilbert@mozilla.com>
Tue, 23 Jan 2018 16:21:09 -0800
changeset 723877 78569fcfe3c75fc1d5702f607803df59c4cce680
parent 723876 f05c483e2f82f00a90107cd7f0f65190909aa82a
child 746981 24c079fbe6e74e1c8d5681424e7d363bca7cde6a
push id96564
push userkgilbert@mozilla.com
push dateWed, 24 Jan 2018 00:26:10 +0000
bugs1381645
milestone60.0a1
Bug 1381645 - Part 4: Update web-platform tests to check WebVR interfaces only with HTTPS MozReview-Commit-ID: BwZqUna9kbD
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/webvr/idlharness.html.ini
testing/web-platform/meta/webvr/idlharness.https.html.ini
testing/web-platform/tests/webvr/idlharness.html
testing/web-platform/tests/webvr/idlharness.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -357228,19 +357228,19 @@
     ]
    ],
    "webusb/usbOutTransferResult.https.html": [
     [
      "/webusb/usbOutTransferResult.https.html",
      {}
     ]
    ],
-   "webvr/idlharness.html": [
-    [
-     "/webvr/idlharness.html",
+   "webvr/idlharness.https.html": [
+    [
+     "/webvr/idlharness.https.html",
      {}
     ]
    ],
    "webvr/webvr-disabled-by-feature-policy.https.sub.html": [
     [
      "/webvr/webvr-disabled-by-feature-policy.https.sub.html",
      {}
     ]
@@ -493514,17 +493514,17 @@
    "a736f68dc602c0fccab56ec5cc6234cb3298c88d",
    "support"
   ],
   "css/css-scoping/shadow-cascade-order-001.html": [
    "46913ea7e47811b11be898de5c3bd0a330ea6637",
    "testharness"
   ],
   "css/css-scoping/slotted-invalidation.html": [
-   "b22e8258671a8709a3ce6fdc42501b43b866e946",
+   "c500e1ceba1b293d45df5f66fd89d4a5d9ceb952",
    "testharness"
   ],
   "css/css-scoping/slotted-parsing.html": [
    "6bac5b15011d7177a40f7ca3e3c5f7e410643920",
    "testharness"
   ],
   "css/css-scoping/slotted-with-pseudo-element-ref.html": [
    "48561a3dff973b7ad1bfa9702461e50fd4a67c2d",
@@ -585725,17 +585725,17 @@
   "webusb/usbOutTransferResult.https.html": [
    "f08a98a927d57cda8b780a8304a0fa6cf727cc81",
    "testharness"
   ],
   "webvr/OWNERS": [
    "adb04954bffbb33f29864668db95f5c5367d6a05",
    "support"
   ],
-  "webvr/idlharness.html": [
+  "webvr/idlharness.https.html": [
    "3505e27e1b2668010bf61f05f6b8a759cf42cece",
    "testharness"
   ],
   "webvr/webvr-disabled-by-feature-policy.https.sub.html": [
    "324e77ca73617cf34b3d7b8fac9844c67cae5e61",
    "testharness"
   ],
   "webvr/webvr-disabled-by-feature-policy.https.sub.html.headers": [
deleted file mode 100644
--- a/testing/web-platform/meta/webvr/idlharness.html.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[idlharness.html]
-  [Window interface: attribute onvrdisplayblur]
-    expected: FAIL
-
-  [Window interface: attribute onvrdisplayfocus]
-    expected: FAIL
-
-  [Navigator interface: attribute vrEnabled]
-    expected: FAIL
-
-  [HTMLIFrameElement interface: attribute allowvr]
-    expected: FAIL
-
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/webvr/idlharness.https.html.ini
@@ -0,0 +1,13 @@
+[idlharness.html]
+  [Window interface: attribute onvrdisplayblur]
+    expected: FAIL
+
+  [Window interface: attribute onvrdisplayfocus]
+    expected: FAIL
+
+  [Navigator interface: attribute vrEnabled]
+    expected: FAIL
+
+  [HTMLIFrameElement interface: attribute allowvr]
+    expected: FAIL
+
deleted file mode 100644
--- a/testing/web-platform/tests/webvr/idlharness.html
+++ /dev/null
@@ -1,240 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset=utf-8>
-    <title>WebVR IDL test</title>
-    <link rel="help" href="https://w3c.github.io/webvr/">
-
-    <script src=/resources/testharness.js></script>
-    <script src=/resources/testharnessreport.js></script>
-    <script src=/resources/WebIDLParser.js></script>
-    <script src=/resources/idlharness.js></script>
-<script id="webvr_idl" type=text/plain>
-// Archived version of the WebVR spec from
-// https://w3c.github.io/webvr/archive/prerelease/1.1/index.html
-
-interface VRDisplay : EventTarget {
-  readonly attribute boolean isPresenting;
-
-  /**
-   * Dictionary of capabilities describing the VRDisplay.
-   */
-  [SameObject] readonly attribute VRDisplayCapabilities capabilities;
-
-  /**
-   * If this VRDisplay supports room-scale experiences, the optional
-   * stage attribute contains details on the room-scale parameters.
-   * The stageParameters attribute can not change between null
-   * and non-null once the VRDisplay is enumerated; however,
-   * the values within VRStageParameters may change after
-   * any call to VRDisplay.submitFrame as the user may re-configure
-   * their environment at any time.
-   */
-  readonly attribute VRStageParameters? stageParameters;
-
-  /**
-   * Return the current VREyeParameters for the given eye.
-   */
-  VREyeParameters getEyeParameters(VREye whichEye);
-
-  /**
-   * An identifier for this distinct VRDisplay. Used as an
-   * association point in the Gamepad API.
-   */
-  readonly attribute unsigned long displayId;
-
-  /**
-   * A display name, a user-readable name identifying it.
-   */
-  readonly attribute DOMString displayName;
-
-  /**
-   * Populates the passed VRFrameData with the information required to render
-   * the current frame.
-   */
-  boolean getFrameData(VRFrameData frameData);
-
-  /**
-   * z-depth defining the near plane of the eye view frustum
-   * enables mapping of values in the render target depth
-   * attachment to scene coordinates. Initially set to 0.01.
-   */
-  attribute double depthNear;
-
-  /**
-   * z-depth defining the far plane of the eye view frustum
-   * enables mapping of values in the render target depth
-   * attachment to scene coordinates. Initially set to 10000.0.
-   */
-  attribute double depthFar;
-
-  /**
-   * The callback passed to `requestAnimationFrame` will be called
-   * any time a new frame should be rendered. When the VRDisplay is
-   * presenting the callback will be called at the native refresh
-   * rate of the HMD. When not presenting this function acts
-   * identically to how window.requestAnimationFrame acts. Content should
-   * make no assumptions of frame rate or vsync behavior as the HMD runs
-   * asynchronously from other displays and at differing refresh rates.
-   */
-  long requestAnimationFrame(FrameRequestCallback callback);
-
-  /**
-   * Passing the value returned by `requestAnimationFrame` to
-   * `cancelAnimationFrame` will unregister the callback.
-   */
-  void cancelAnimationFrame(long handle);
-
-  /**
-   * Begin presenting to the VRDisplay. Must be called in response to a user gesture.
-   * Repeat calls while already presenting will update the layers being displayed.
-   * If the number of values in the leftBounds/rightBounds arrays is not 0 or 4 for any of the passed layers the promise is rejected
-   * If the source of any of the layers is not present (null), the promise is rejected.
-   */
-  Promise<void> requestPresent(sequence<VRLayerInit> layers);
-
-  /**
-   * Stops presenting to the VRDisplay.
-   */
-  Promise<void> exitPresent();
-
-  /**
-   * Get the layers currently being presented.
-   */
-  sequence<VRLayerInit> getLayers();
-
-  /**
-   * The layer provided to the VRDisplay will be captured and presented
-   * in the HMD. Calling this function has the same effect on the source
-   * canvas as any other operation that uses its source image, and canvases
-   * created without preserveDrawingBuffer set to true will be cleared.
-   */
-  void submitFrame();
-};
-
-typedef (HTMLCanvasElement or
-         OffscreenCanvas) VRSource;
-
-dictionary VRLayerInit {
-  VRSource? source = null;
-
-  sequence<float> leftBounds = [];
-  sequence<float> rightBounds = [];
-};
-
-interface VRDisplayCapabilities {
-  readonly attribute boolean hasPosition;
-  readonly attribute boolean hasExternalDisplay;
-  readonly attribute boolean canPresent;
-  readonly attribute unsigned long maxLayers;
-};
-
-enum VREye {
-  "left",
-  "right"
-};
-
-interface VRPose {
-  readonly attribute Float32Array? position;
-  readonly attribute Float32Array? linearVelocity;
-  readonly attribute Float32Array? linearAcceleration;
-
-  readonly attribute Float32Array? orientation;
-  readonly attribute Float32Array? angularVelocity;
-  readonly attribute Float32Array? angularAcceleration;
-};
-
-[Constructor]
-interface VRFrameData {
-  readonly attribute Float32Array leftProjectionMatrix;
-  readonly attribute Float32Array leftViewMatrix;
-
-  readonly attribute Float32Array rightProjectionMatrix;
-  readonly attribute Float32Array rightViewMatrix;
-
-  readonly attribute VRPose pose;
-};
-
-interface VREyeParameters {
-  readonly attribute Float32Array offset;
-
-  readonly attribute unsigned long renderWidth;
-  readonly attribute unsigned long renderHeight;
-};
-
-interface VRStageParameters {
-  readonly attribute Float32Array sittingToStandingTransform;
-
-  readonly attribute float sizeX;
-  readonly attribute float sizeZ;
-};
-
-partial interface Navigator {
-  Promise<sequence<VRDisplay>> getVRDisplays();
-  readonly attribute FrozenArray<VRDisplay> activeVRDisplays;
-  readonly attribute boolean vrEnabled;
-};
-
-enum VRDisplayEventReason {
-  "mounted",
-  "navigation",
-  "requested",
-  "unmounted"
-};
-
-[Constructor(DOMString type, VRDisplayEventInit eventInitDict)]
-interface VRDisplayEvent : Event {
-  readonly attribute VRDisplay display;
-  readonly attribute VRDisplayEventReason? reason;
-};
-
-dictionary VRDisplayEventInit : EventInit {
-  required VRDisplay display;
-  VRDisplayEventReason reason;
-};
-
-partial interface Window {
-  attribute EventHandler onvrdisplayconnect;
-  attribute EventHandler onvrdisplaydisconnect;
-  attribute EventHandler onvrdisplayactivate;
-  attribute EventHandler onvrdisplaydeactivate;
-  attribute EventHandler onvrdisplayblur;
-  attribute EventHandler onvrdisplayfocus;
-  attribute EventHandler onvrdisplaypresentchange;
-};
-
-partial interface HTMLIFrameElement {
-  attribute boolean allowvr;
-};
-
-partial interface Gamepad {
-  readonly attribute unsigned long displayId;
-};
-</script>
-  </head>
-  <body>
-    <h1 class="instructions">Description</h1>
-    <p class="instructions">
-      This test verifies that implementations of the WebVR API match its WebIDL definition.
-    </p>
-
-    <div id='log'></div>
-
-    <script>
-      setup( () => {
-        var idl_array = new IdlArray();
-        idl_array.add_untested_idls("[Global=Window, Exposed=Window] interface Window {};");
-        idl_array.add_untested_idls("interface Navigator {};");
-        idl_array.add_untested_idls("interface Event {};");
-        idl_array.add_untested_idls("interface EventTarget {};");
-        idl_array.add_untested_idls("interface HTMLIFrameElement {};");
-        idl_array.add_untested_idls("interface Gamepad {};");
-
-        idl_array.add_idls(document.getElementById("webvr_idl").textContent);
-
-        idl_array.test();
-        done();
-      }, {explicit_done: true});
-    </script>
-  </body>
-</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webvr/idlharness.https.html
@@ -0,0 +1,240 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>WebVR IDL test</title>
+    <link rel="help" href="https://w3c.github.io/webvr/">
+
+    <script src=/resources/testharness.js></script>
+    <script src=/resources/testharnessreport.js></script>
+    <script src=/resources/WebIDLParser.js></script>
+    <script src=/resources/idlharness.js></script>
+<script id="webvr_idl" type=text/plain>
+// Archived version of the WebVR spec from
+// https://w3c.github.io/webvr/archive/prerelease/1.1/index.html
+
+interface VRDisplay : EventTarget {
+  readonly attribute boolean isPresenting;
+
+  /**
+   * Dictionary of capabilities describing the VRDisplay.
+   */
+  [SameObject] readonly attribute VRDisplayCapabilities capabilities;
+
+  /**
+   * If this VRDisplay supports room-scale experiences, the optional
+   * stage attribute contains details on the room-scale parameters.
+   * The stageParameters attribute can not change between null
+   * and non-null once the VRDisplay is enumerated; however,
+   * the values within VRStageParameters may change after
+   * any call to VRDisplay.submitFrame as the user may re-configure
+   * their environment at any time.
+   */
+  readonly attribute VRStageParameters? stageParameters;
+
+  /**
+   * Return the current VREyeParameters for the given eye.
+   */
+  VREyeParameters getEyeParameters(VREye whichEye);
+
+  /**
+   * An identifier for this distinct VRDisplay. Used as an
+   * association point in the Gamepad API.
+   */
+  readonly attribute unsigned long displayId;
+
+  /**
+   * A display name, a user-readable name identifying it.
+   */
+  readonly attribute DOMString displayName;
+
+  /**
+   * Populates the passed VRFrameData with the information required to render
+   * the current frame.
+   */
+  boolean getFrameData(VRFrameData frameData);
+
+  /**
+   * z-depth defining the near plane of the eye view frustum
+   * enables mapping of values in the render target depth
+   * attachment to scene coordinates. Initially set to 0.01.
+   */
+  attribute double depthNear;
+
+  /**
+   * z-depth defining the far plane of the eye view frustum
+   * enables mapping of values in the render target depth
+   * attachment to scene coordinates. Initially set to 10000.0.
+   */
+  attribute double depthFar;
+
+  /**
+   * The callback passed to `requestAnimationFrame` will be called
+   * any time a new frame should be rendered. When the VRDisplay is
+   * presenting the callback will be called at the native refresh
+   * rate of the HMD. When not presenting this function acts
+   * identically to how window.requestAnimationFrame acts. Content should
+   * make no assumptions of frame rate or vsync behavior as the HMD runs
+   * asynchronously from other displays and at differing refresh rates.
+   */
+  long requestAnimationFrame(FrameRequestCallback callback);
+
+  /**
+   * Passing the value returned by `requestAnimationFrame` to
+   * `cancelAnimationFrame` will unregister the callback.
+   */
+  void cancelAnimationFrame(long handle);
+
+  /**
+   * Begin presenting to the VRDisplay. Must be called in response to a user gesture.
+   * Repeat calls while already presenting will update the layers being displayed.
+   * If the number of values in the leftBounds/rightBounds arrays is not 0 or 4 for any of the passed layers the promise is rejected
+   * If the source of any of the layers is not present (null), the promise is rejected.
+   */
+  Promise<void> requestPresent(sequence<VRLayerInit> layers);
+
+  /**
+   * Stops presenting to the VRDisplay.
+   */
+  Promise<void> exitPresent();
+
+  /**
+   * Get the layers currently being presented.
+   */
+  sequence<VRLayerInit> getLayers();
+
+  /**
+   * The layer provided to the VRDisplay will be captured and presented
+   * in the HMD. Calling this function has the same effect on the source
+   * canvas as any other operation that uses its source image, and canvases
+   * created without preserveDrawingBuffer set to true will be cleared.
+   */
+  void submitFrame();
+};
+
+typedef (HTMLCanvasElement or
+         OffscreenCanvas) VRSource;
+
+dictionary VRLayerInit {
+  VRSource? source = null;
+
+  sequence<float> leftBounds = [];
+  sequence<float> rightBounds = [];
+};
+
+interface VRDisplayCapabilities {
+  readonly attribute boolean hasPosition;
+  readonly attribute boolean hasExternalDisplay;
+  readonly attribute boolean canPresent;
+  readonly attribute unsigned long maxLayers;
+};
+
+enum VREye {
+  "left",
+  "right"
+};
+
+interface VRPose {
+  readonly attribute Float32Array? position;
+  readonly attribute Float32Array? linearVelocity;
+  readonly attribute Float32Array? linearAcceleration;
+
+  readonly attribute Float32Array? orientation;
+  readonly attribute Float32Array? angularVelocity;
+  readonly attribute Float32Array? angularAcceleration;
+};
+
+[Constructor]
+interface VRFrameData {
+  readonly attribute Float32Array leftProjectionMatrix;
+  readonly attribute Float32Array leftViewMatrix;
+
+  readonly attribute Float32Array rightProjectionMatrix;
+  readonly attribute Float32Array rightViewMatrix;
+
+  readonly attribute VRPose pose;
+};
+
+interface VREyeParameters {
+  readonly attribute Float32Array offset;
+
+  readonly attribute unsigned long renderWidth;
+  readonly attribute unsigned long renderHeight;
+};
+
+interface VRStageParameters {
+  readonly attribute Float32Array sittingToStandingTransform;
+
+  readonly attribute float sizeX;
+  readonly attribute float sizeZ;
+};
+
+partial interface Navigator {
+  Promise<sequence<VRDisplay>> getVRDisplays();
+  readonly attribute FrozenArray<VRDisplay> activeVRDisplays;
+  readonly attribute boolean vrEnabled;
+};
+
+enum VRDisplayEventReason {
+  "mounted",
+  "navigation",
+  "requested",
+  "unmounted"
+};
+
+[Constructor(DOMString type, VRDisplayEventInit eventInitDict)]
+interface VRDisplayEvent : Event {
+  readonly attribute VRDisplay display;
+  readonly attribute VRDisplayEventReason? reason;
+};
+
+dictionary VRDisplayEventInit : EventInit {
+  required VRDisplay display;
+  VRDisplayEventReason reason;
+};
+
+partial interface Window {
+  attribute EventHandler onvrdisplayconnect;
+  attribute EventHandler onvrdisplaydisconnect;
+  attribute EventHandler onvrdisplayactivate;
+  attribute EventHandler onvrdisplaydeactivate;
+  attribute EventHandler onvrdisplayblur;
+  attribute EventHandler onvrdisplayfocus;
+  attribute EventHandler onvrdisplaypresentchange;
+};
+
+partial interface HTMLIFrameElement {
+  attribute boolean allowvr;
+};
+
+partial interface Gamepad {
+  readonly attribute unsigned long displayId;
+};
+</script>
+  </head>
+  <body>
+    <h1 class="instructions">Description</h1>
+    <p class="instructions">
+      This test verifies that implementations of the WebVR API match its WebIDL definition.
+    </p>
+
+    <div id='log'></div>
+
+    <script>
+      setup( () => {
+        var idl_array = new IdlArray();
+        idl_array.add_untested_idls("[Global=Window, Exposed=Window] interface Window {};");
+        idl_array.add_untested_idls("interface Navigator {};");
+        idl_array.add_untested_idls("interface Event {};");
+        idl_array.add_untested_idls("interface EventTarget {};");
+        idl_array.add_untested_idls("interface HTMLIFrameElement {};");
+        idl_array.add_untested_idls("interface Gamepad {};");
+
+        idl_array.add_idls(document.getElementById("webvr_idl").textContent);
+
+        idl_array.test();
+        done();
+      }, {explicit_done: true});
+    </script>
+  </body>
+</html>