Bug 1374640 - always prompt for screen sharing. r=florian,jib

MozReview-Commit-ID: FJvuf2XVZXJ

--HG--
extra : rebase_source : 4c4b00c1128448da6c0d73b032d8629b80ff01c3
This commit is contained in:
Munro Mengjue Chiang 2017-06-29 15:50:30 -07:00
Родитель 49915f0bcd
Коммит 8937814170
2 изменённых файлов: 31 добавлений и 11 удалений

Просмотреть файл

@ -91,6 +91,23 @@ var gTests = [
await indicator;
await checkSharingUI({screen: "Screen"});
// we always show prompt for screen sharing.
promise = promisePopupNotificationShown("webRTC-shareDevices");
await promiseRequestDevice(false, true, null, "screen");
await promise;
await expectObserverCalled("getUserMedia:request");
is(PopupNotifications.getNotification("webRTC-shareDevices").anchorID,
"webRTC-shareScreen-notification-icon", "anchored to device icon");
checkDeviceSelectors(false, false, true);
await promiseMessage(permissionError, () => {
PopupNotifications.panel.firstChild.button.click();
});
await expectObserverCalled("getUserMedia:response:deny");
SitePermissions.remove(null, "screen", gBrowser.selectedBrowser);
await closeStream();
}
},

Просмотреть файл

@ -479,19 +479,22 @@ function prompt(aBrowser, aRequest) {
let activeCamera;
let activeMic;
for (let device of videoDevices) {
let set = webrtcUI.activePerms.get(aBrowser.outerWindowID);
if (set && set.has(aRequest.windowID + device.mediaSource + device.id)) {
activeCamera = device;
break;
// Always prompt for screen sharing
if (!sharingScreen) {
for (let device of videoDevices) {
let set = webrtcUI.activePerms.get(aBrowser.outerWindowID);
if (set && set.has(aRequest.windowID + device.mediaSource + device.id)) {
activeCamera = device;
break;
}
}
}
for (let device of audioDevices) {
let set = webrtcUI.activePerms.get(aBrowser.outerWindowID);
if (set && set.has(aRequest.windowID + device.mediaSource + device.id)) {
activeMic = device;
break;
for (let device of audioDevices) {
let set = webrtcUI.activePerms.get(aBrowser.outerWindowID);
if (set && set.has(aRequest.windowID + device.mediaSource + device.id)) {
activeMic = device;
break;
}
}
}