Bug 1465584 [wpt PR 11255] - Move media-capabilities IDL to interfaces, a=testonly
authorChris Nardi <christopherncarmel@hotmail.com>
Wed, 06 Jun 2018 16:53:35 +0000
changeset 422226 b9780530a75c202c8f9c75c35c64a5e2af960221
parent 422225 cc6299605cfd1da0f219fda288f2a42837935a95
child 422227 a5efb452762ccfe7d675d60f85604220a442e679
push id34122
push userebalazs@mozilla.com
push dateMon, 11 Jun 2018 09:37:00 +0000
treeherdermozilla-central@9941eb8c3b29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1465584, 11255
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1465584 [wpt PR 11255] - Move media-capabilities IDL to interfaces, a=testonly Automatic update from web-platform-testsMove media-capabilities IDL to interfaces The media-capabilities IDL was defined directly in the idlharness test. This change moves the IDL definitions into its own file in interfaces. This change also updates the definitions per the latest version of the spec. -- wpt-commits: 6e632ba33a74d71e3ccff8126e55710f3e5f1b3a wpt-pr: 11255
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/interfaces/media-capabilities.idl
testing/web-platform/tests/media-capabilities/idlharness.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -287239,16 +287239,21 @@
      {}
     ]
    ],
    "interfaces/magnetometer.idl": [
     [
      {}
     ]
    ],
+   "interfaces/media-capabilities.idl": [
+    [
+     {}
+    ]
+   ],
    "interfaces/mediacapture-main.idl": [
     [
      {}
     ]
    ],
    "interfaces/orientation-sensor.idl": [
     [
      {}
@@ -581153,16 +581158,20 @@
   "interfaces/keyboard-map.idl": [
    "1e9e311a4d347d9f036702d29ef0bc82fca04162",
    "support"
   ],
   "interfaces/magnetometer.idl": [
    "ffac480912edba82886fef6d5368092d237a0c7f",
    "support"
   ],
+  "interfaces/media-capabilities.idl": [
+   "17413896d6281553091cf2c369c29de42d450962",
+   "support"
+  ],
   "interfaces/mediacapture-main.idl": [
    "3400c775504ebf32af3f8e1165a53ca60f258495",
    "support"
   ],
   "interfaces/orientation-sensor.idl": [
    "1f0698a8611726b1ba724a5d7a0961e836c7b07e",
    "support"
   ],
@@ -582098,17 +582107,17 @@
    "7d6ceec9a74d5485a6f7d51504f22e5eaf81bfee",
    "support"
   ],
   "media-capabilities/decodingInfo.html": [
    "3cafa5d2375c8f42abee8f22293705eaa6dca019",
    "testharness"
   ],
   "media-capabilities/idlharness.html": [
-   "396430dee8bc806e95a218e03f767b34efe8fe83",
+   "6cbda5261b98a04d1ad5c3c9816a443e67d7d523",
    "testharness"
   ],
   "media-source/OWNERS": [
    "90e737b8379ed92920c5f9f37ec653c758b93d9c",
    "support"
   ],
   "media-source/SourceBuffer-abort-readyState.html": [
    "37a54dbcd043c9bb53f51ccfc58ca42f91df0a24",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/interfaces/media-capabilities.idl
@@ -0,0 +1,78 @@
+dictionary MediaConfiguration {
+  VideoConfiguration video;
+  AudioConfiguration audio;
+};
+
+dictionary MediaDecodingConfiguration : MediaConfiguration {
+  required MediaDecodingType type;
+};
+
+dictionary MediaEncodingConfiguration : MediaConfiguration {
+  required MediaEncodingType type;
+};
+
+enum MediaDecodingType {
+  "file",
+  "media-source",
+};
+
+enum MediaEncodingType {
+  "record",
+  "transmission"
+};
+
+dictionary VideoConfiguration {
+  required DOMString contentType;
+  required unsigned long width;
+  required unsigned long height;
+  required unsigned long long bitrate;
+  required DOMString framerate;
+};
+
+dictionary AudioConfiguration {
+  required DOMString contentType;
+  DOMString channels;
+  unsigned long long bitrate;
+  unsigned long samplerate;
+};
+
+interface MediaCapabilitiesInfo {
+  readonly attribute boolean supported;
+  readonly attribute boolean smooth;
+  readonly attribute boolean powerEfficient;
+};
+
+[Exposed=(Window)]
+partial interface Navigator {
+  [SameObject] readonly attribute MediaCapabilities mediaCapabilities;
+};
+
+[Exposed=(Worker)]
+partial interface WorkerNavigator {
+  [SameObject] readonly attribute MediaCapabilities mediaCapabilities;
+};
+
+[Exposed=(Window, Worker)]
+interface MediaCapabilities {
+  Promise<MediaCapabilitiesInfo> decodingInfo(MediaDecodingConfiguration configuration);
+  Promise<MediaCapabilitiesInfo> encodingInfo(MediaEncodingConfiguration configuration);
+};
+
+interface ScreenLuminance {
+  readonly attribute double min;
+  readonly attribute double max;
+  readonly attribute double maxAverage;
+};
+
+enum ScreenColorGamut {
+  "srgb",
+  "p3",
+  "rec2020",
+};
+
+partial interface Screen {
+  readonly attribute ScreenColorGamut colorGamut;
+  readonly attribute ScreenLuminance? luminance;
+
+  attribute EventHandler onchange;
+};
--- a/testing/web-platform/tests/media-capabilities/idlharness.html
+++ b/testing/web-platform/tests/media-capabilities/idlharness.html
@@ -6,87 +6,32 @@
 <link rel="help" href="https://wicg.github.io/media-capabilities/"/>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/resources/WebIDLParser.js"></script>
 <script src="/resources/idlharness.js"></script>
 </head>
 <body>
 <h1>Media Session IDL tests</h1>
-<pre id='untested_idl' style='display:none'>
-[Global=Window, Exposed=Window]
-interface Window {
-};
-interface Worker {
-};
-interface Navigator {
-};
-interface WorkerNavigator {
-};
-</pre>
-<pre id='idl'>
-dictionary MediaConfiguration {
-  VideoConfiguration video;
-  AudioConfiguration audio;
-};
-
-dictionary MediaDecodingConfiguration : MediaConfiguration {
-  required MediaDecodingType type;
-};
-
-dictionary MediaEncodingConfiguration : MediaConfiguration {
-  required MediaEncodingType type;
-};
-
-enum MediaDecodingType {
-  "file",
-  "media-source",
-};
-
-dictionary VideoConfiguration {
-  required DOMString contentType;
-  required unsigned long width;
-  required unsigned long height;
-  required unsigned long bitrate;
-  required double framerate;
-};
-
-dictionary AudioConfiguration {
-  required DOMString contentType;
-  DOMString channels;
-  unsigned long bitrate;
-  unsigned long samplerate;
-};
-
-interface MediaCapabilitiesInfo {
-  readonly attribute boolean supported;
-  readonly attribute boolean smooth;
-  readonly attribute boolean powerEfficient;
-};
-
-[Exposed=(Window)]
-partial interface Navigator {
-  [SameObject] readonly attribute MediaCapabilities mediaCapabilities;
-};
-
-[Exposed=(Worker)]
-partial interface WorkerNavigator {
-  [SameObject] readonly attribute MediaCapabilities mediaCapabilities;
-};
-
-[Exposed=(Window, Worker)]
-interface MediaCapabilities {
-  Promise<MediaCapabilitiesInfo> decodingInfo(MediaDecodingConfiguration configuration);
-  Promise<MediaCapabilitiesInfo> encodingInfo(MediaEncodingConfiguration configuration);
-};
-</pre>
 <script>
-var idl_array = new IdlArray();
-idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
-idl_array.add_idls(document.getElementById("idl").textContent);
-idl_array.add_objects({
-  Navigator: ["navigator"]
-});
-idl_array.test();
+"use strict";
+function doTest([media_capabilities]) {
+    var idl_array = new IdlArray();
+    idl_array.add_untested_idls('interface Navigator {};');
+    idl_array.add_untested_idls('interface WorkerNavigator {};');
+    idl_array.add_untested_idls('interface Screen {};');
+    idl_array.add_idls(media_capabilities);
+    idl_array.add_objects({
+      Navigator: ["navigator"]
+    });
+    idl_array.test();
+}
+function fetchText(url) {
+    return fetch(url).then((response) => response.text());
+}
+promise_test(() => {
+    return Promise.all(["/interfaces/media-capabilities.idl"].map(fetchText))
+                  .then(doTest);
+}, "Test IDL implementation of Media Session");
 </script>
 <div id="log"></div>
 </body>
 </html>