diff --git a/dom/media/tests/mochitest/test_enumerateDevices.html b/dom/media/tests/mochitest/test_enumerateDevices.html index 7db3c894c474..9582d91c15fa 100644 --- a/dom/media/tests/mochitest/test_enumerateDevices.html +++ b/dom/media/tests/mochitest/test_enumerateDevices.html @@ -34,6 +34,9 @@ runTest(() => ok(d.label.length !== undefined, "Device label: " + d.label); is(d.groupId, "", "Don't support groupId yet"); }); + var jsoned = JSON.parse(JSON.stringify(devices)); + is(jsoned[0].kind, devices[0].kind, "kind survived serializer"); + is(jsoned[0].deviceId, devices[0].deviceId, "deviceId survived serializer"); }) // Check deviceId failure paths for video. .then(() => mustSucceed("unknown plain deviceId on video", diff --git a/dom/webidl/MediaDeviceInfo.webidl b/dom/webidl/MediaDeviceInfo.webidl index fe28aa5bab6d..b42519ad1319 100644 --- a/dom/webidl/MediaDeviceInfo.webidl +++ b/dom/webidl/MediaDeviceInfo.webidl @@ -19,4 +19,6 @@ interface MediaDeviceInfo { readonly attribute MediaDeviceKind kind; readonly attribute DOMString label; readonly attribute DOMString groupId; + + jsonifier; };