Changeset 237643 in webkit
- Timestamp:
- Oct 31, 2018, 10:26:49 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/fast/mediastream/MediaStreamTrack-getCapabilities.html (modified) (2 diffs)
-
LayoutTests/fast/mediastream/get-user-media-device-id-expected.txt (modified) (1 diff)
-
LayoutTests/fast/mediastream/get-user-media-device-id.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r237642 r237643 1 2018-10-31 Eric Carlson <eric.carlson@apple.com> 2 3 [MediaStream] Don't reveal device IDs until the user has granted permission to capture 4 https://bugs.webkit.org/show_bug.cgi?id=191112 5 <rdar://problem/45699932> 6 7 Reviewed by Youenn Fablet. 8 9 * TestExpectations: Skip http/tests/media/media-stream/enumerate-devices-source-id-persistent.html 10 and http/tests/media/media-stream/enumerate-devices-source-id.html for now, they don't make sense 11 with these changes and will be updated to pass in a future patch. 12 * fast/mediastream/MediaStreamTrack-getCapabilities.html: 13 * fast/mediastream/get-user-media-device-id-expected.txt: 14 * fast/mediastream/get-user-media-device-id.html: 15 1 16 2018-10-31 YUHAN WU <yuhan_wu@apple.com> 2 17 -
trunk/LayoutTests/TestExpectations
r237587 r237643 2905 2905 fast/mediacapturefromelement/CanvasCaptureMediaStream-framerate-0.html [ Skip ] 2906 2906 fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html [ Skip ] 2907 2908 # FIXME: The behavior of navigator.mediaDevices.enumerateDevices is in flux, skip these tests for now. 2909 http/tests/media/media-stream/enumerate-devices-source-id-persistent.html [ Skip ] 2910 http/tests/media/media-stream/enumerate-devices-source-id.html [ Skip ] -
trunk/LayoutTests/fast/mediastream/MediaStreamTrack-getCapabilities.html
r232754 r237643 3 3 <head> 4 4 <script src="../../resources/js-test-pre.js"></script> 5 <script src="./resources/getUserMedia-helper.js"></script>6 5 <script> 7 6 var mediaStream; 8 7 var devices; 8 9 if (window.testRunner) 10 testRunner.setUserMediaPermission(true); 9 11 10 12 function limitPrecision(value, precision) … … 81 83 } 82 84 83 function start()85 async function start() 84 86 { 85 87 description("Tests MediaStreamTrack.getCapabilities."); 86 navigator.mediaDevices.enumerateDevices().then(deviceInfoArray => { 87 devices = deviceInfoArray;88 getUserMedia("allow", {audio:true, video:true}, gotStream);89 }, e => { 90 testFailed('enumerateDevices failed:' + e);91 finishJSTest();92 });88 89 mediaStream = await navigator.mediaDevices.getUserMedia({ audio:true, video:true }); 90 devices = await navigator.mediaDevices.enumerateDevices(); 91 92 listTrackProperties(mediaStream.getVideoTracks()[0]); 93 listTrackProperties(mediaStream.getAudioTracks()[0]); 94 finishJSTest(); 93 95 } 94 96 -
trunk/LayoutTests/fast/mediastream/get-user-media-device-id-expected.txt
r216836 r237643 1 1 2 PASS Device IDs should be empty initially 2 3 PASS Collect device IDs 3 4 PASS Pass device IDs as exact constraints -
trunk/LayoutTests/fast/mediastream/get-user-media-device-id.html
r222471 r237643 16 16 .then((devices) => { 17 17 devices.forEach((device) => { 18 assert_true(device.deviceId.length == 0 , "device.deviceId is empty before permission to capture"); 19 }); 20 }); 21 }, "Device IDs should be empty initially"); 22 23 promise_test((test) => { 24 return navigator.mediaDevices.getUserMedia({ audio:true, video:true }) 25 .then((stream) => { 26 return navigator.mediaDevices.enumerateDevices(); 27 }).then(devices => { 28 devices.forEach((device) => { 18 29 let kind = device.kind == "audioinput" ? "audio" : "video"; 19 30 deviceIds.push({ type: kind, id : device.deviceId}); … … 21 32 }); 22 33 }, "Collect device IDs"); 23 34 24 35 let constraints = { }; 25 36 -
trunk/Source/WebCore/ChangeLog
r237642 r237643 1 2018-10-31 Eric Carlson <eric.carlson@apple.com> 2 3 [MediaStream] Don't reveal device IDs until the user has granted permission to capture 4 https://bugs.webkit.org/show_bug.cgi?id=191112 5 <rdar://problem/45699932> 6 7 Reviewed by Youenn Fablet. 8 9 No new tests, existing tests updated. 10 11 * Modules/mediastream/MediaDevicesRequest.cpp: 12 (WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user 13 has granted permssion to capture. 14 1 15 2018-10-31 YUHAN WU <yuhan_wu@apple.com> 2 16 -
trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp
r237266 r237643 116 116 117 117 Vector<Ref<MediaDeviceInfo>> devices; 118 bool revealIdsAndLabels = originHasPersistentAccess || document.hasHadCaptureMediaStreamTrack(); 118 119 for (auto& deviceInfo : captureDevices) { 119 120 auto label = emptyString(); 120 if (originHasPersistentAccess || document.hasHadCaptureMediaStreamTrack()) 121 auto id = emptyString(); 122 auto groupId = emptyString(); 123 if (revealIdsAndLabels) { 121 124 label = deviceInfo.label(); 125 id = RealtimeMediaSourceCenter::singleton().hashStringWithSalt(deviceInfo.persistentId(), deviceIdentifierHashSalt); 126 if (id.isEmpty()) 127 continue; 128 groupId = RealtimeMediaSourceCenter::singleton().hashStringWithSalt(deviceInfo.groupId(), deviceIdentifierHashSalt); 129 } 122 130 123 auto id = RealtimeMediaSourceCenter::singleton().hashStringWithSalt(deviceInfo.persistentId(), deviceIdentifierHashSalt);124 if (id.isEmpty())125 continue;126 127 auto groupId = RealtimeMediaSourceCenter::singleton().hashStringWithSalt(deviceInfo.groupId(), deviceIdentifierHashSalt);128 131 auto deviceType = deviceInfo.type() == CaptureDevice::DeviceType::Microphone ? MediaDeviceInfo::Kind::Audioinput : MediaDeviceInfo::Kind::Videoinput; 129 132 devices.append(MediaDeviceInfo::create(scriptExecutionContext(), label, id, groupId, deviceType)); 130 133 } 131 134 132 if (! originHasPersistentAccess && !document.hasHadCaptureMediaStreamTrack())135 if (!revealIdsAndLabels) 133 136 filterDeviceList(devices); 134 137
Note:
See TracChangeset
for help on using the changeset viewer.