Title: [217476] trunk
Revision
217476
Author
[email protected]
Date
2017-05-25 22:39:12 -0700 (Thu, 25 May 2017)

Log Message

Fix MediaDeviceInfo's extended attributes so they make sense
https://bugs.webkit.org/show_bug.cgi?id=172629

Patch by Sam Weinig <[email protected]> on 2017-05-25
Reviewed by Daniel Bates.

Source/WebCore:

MediaDeviceInfo.idl had both a Constructor and NoInterfaceObject, which
doesn't really make sense. Either way, the spec says it should have
neither, so remove both. And, while were there, add missing serializer.

Test: fast/mediastream/media-device-info.html

* Modules/mediastream/MediaDeviceInfo.idl:

LayoutTests:

* fast/mediastream/media-device-info-expected.txt: Added.
* fast/mediastream/media-device-info.html: Added.
Test that MediaDeviceInfo has the expected properties and that
the serializer works.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (217475 => 217476)


--- trunk/LayoutTests/ChangeLog	2017-05-26 04:41:22 UTC (rev 217475)
+++ trunk/LayoutTests/ChangeLog	2017-05-26 05:39:12 UTC (rev 217476)
@@ -1,3 +1,15 @@
+2017-05-25  Sam Weinig  <[email protected]>
+
+        Fix MediaDeviceInfo's extended attributes so they make sense
+        https://bugs.webkit.org/show_bug.cgi?id=172629
+
+        Reviewed by Daniel Bates.
+
+        * fast/mediastream/media-device-info-expected.txt: Added.
+        * fast/mediastream/media-device-info.html: Added.
+        Test that MediaDeviceInfo has the expected properties and that
+        the serializer works.
+
 2017-05-25  Chris Dumez  <[email protected]>
 
         imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html is crashing

Added: trunk/LayoutTests/fast/mediastream/media-device-info-expected.txt (0 => 217476)


--- trunk/LayoutTests/fast/mediastream/media-device-info-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/media-device-info-expected.txt	2017-05-26 05:39:12 UTC (rev 217476)
@@ -0,0 +1,3 @@
+
+PASS Test properties of MediaDeviceInfo 
+

Added: trunk/LayoutTests/fast/mediastream/media-device-info.html (0 => 217476)


--- trunk/LayoutTests/fast/mediastream/media-device-info.html	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/media-device-info.html	2017-05-26 05:39:12 UTC (rev 217476)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>Test passing capture device IDs to getUserMedia</title>
+    <script src=""
+    <script src=""
+    <script>
+    var devices = [];
+
+    if (window.testRunner)
+        testRunner.setUserMediaPermission(true);
+
+    promise_test((test) => {
+        return navigator.mediaDevices.enumerateDevices()
+            .then((devices) => {
+                assert_greater_than(devices.length, 0);
+                let device = devices[0];
+                
+                assert_true(device instanceof MediaDeviceInfo);
+                assert_class_string(device, "MediaDeviceInfo");
+                assert_true('deviceId' in device);
+                assert_true('kind' in device);
+                assert_true('label' in device);
+                assert_true('groupId' in device);
+                assert_true('toJSON' in device);
+                
+                let serializedResult = device.toJSON();
+                assert_equals(serializedResult['deviceId'], device.deviceId);
+                assert_equals(serializedResult['kind'], device.kind);
+                assert_equals(serializedResult['label'], device.label);
+                assert_equals(serializedResult['groupId'], device.groupId);
+            });
+    }, "Test properties of MediaDeviceInfo");
+
+    </script>
+</head>
+<body>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (217475 => 217476)


--- trunk/Source/WebCore/ChangeLog	2017-05-26 04:41:22 UTC (rev 217475)
+++ trunk/Source/WebCore/ChangeLog	2017-05-26 05:39:12 UTC (rev 217476)
@@ -1,3 +1,18 @@
+2017-05-25  Sam Weinig  <[email protected]>
+
+        Fix MediaDeviceInfo's extended attributes so they make sense
+        https://bugs.webkit.org/show_bug.cgi?id=172629
+
+        Reviewed by Daniel Bates.
+
+        MediaDeviceInfo.idl had both a Constructor and NoInterfaceObject, which
+        doesn't really make sense. Either way, the spec says it should have 
+        neither, so remove both. And, while were there, add missing serializer.
+
+        Test: fast/mediastream/media-device-info.html
+
+        * Modules/mediastream/MediaDeviceInfo.idl:
+
 2017-05-25  Chris Dumez  <[email protected]>
 
         imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html is crashing

Modified: trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl (217475 => 217476)


--- trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl	2017-05-26 04:41:22 UTC (rev 217475)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl	2017-05-26 05:39:12 UTC (rev 217476)
@@ -25,16 +25,13 @@
 
 [
     Conditional=MEDIA_STREAM,
-    Constructor(DOMString deviceId, DOMString label, DOMString groupId, MediaDeviceKind kind),
     JSGenerateToJSObject,
-    NoInterfaceObject,
 ] interface MediaDeviceInfo {
     readonly attribute DOMString deviceId;
     readonly attribute MediaDeviceKind kind;
     readonly attribute DOMString label;
     readonly attribute DOMString groupId;
-
-    // FIXME 169871: missing serializer
+    serializer = {attribute};
 };
 
 // FIXME 169871: missing InputDeviceInfo
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to