зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1294576 - Remove device sharing indicator on location changes, r=johannh.
This commit is contained in:
Родитель
1a53278e41
Коммит
564b3b6ddd
|
@ -4837,6 +4837,12 @@ var TabsProgressListener = {
|
|||
if (!Object.getOwnPropertyDescriptor(window, "PopupNotifications").get)
|
||||
PopupNotifications.locationChange(aBrowser);
|
||||
|
||||
let tab = gBrowser.getTabForBrowser(aBrowser);
|
||||
if (tab && tab._sharingState) {
|
||||
gBrowser.setBrowserSharing(aBrowser, {});
|
||||
webrtcUI.forgetStreamsFromBrowser(aBrowser);
|
||||
}
|
||||
|
||||
gBrowser.getNotificationBox(aBrowser).removeTransientNotifications();
|
||||
|
||||
FullZoom.onLocationChange(aLocationURI, false, aBrowser);
|
||||
|
|
|
@ -197,6 +197,41 @@ var gTests = [
|
|||
yield expectNoObserverCalled();
|
||||
yield checkNotSharing();
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
desc: "getUserMedia audio+video: reloading the top level page removes all sharing UI",
|
||||
run: function* checkReloading() {
|
||||
let promise = promisePopupNotificationShown("webRTC-shareDevices");
|
||||
yield promiseRequestDevice(true, true, "frame1");
|
||||
yield promise;
|
||||
yield expectObserverCalled("getUserMedia:request");
|
||||
checkDeviceSelectors(true, true);
|
||||
|
||||
let indicator = promiseIndicatorWindow();
|
||||
yield promiseMessage("ok", () => {
|
||||
PopupNotifications.panel.firstChild.button.click();
|
||||
});
|
||||
yield expectObserverCalled("getUserMedia:response:allow");
|
||||
yield expectObserverCalled("recording-device-events");
|
||||
is((yield getMediaCaptureState()), "CameraAndMicrophone",
|
||||
"expected camera and microphone to be shared");
|
||||
|
||||
yield indicator;
|
||||
yield checkSharingUI({video: true, audio: true});
|
||||
|
||||
info("reloading the web page");
|
||||
promise = promiseObserverCalled("recording-device-events");
|
||||
content.location.reload();
|
||||
yield promise;
|
||||
|
||||
if ((yield promiseTodoObserverNotCalled("recording-device-events")) == 1) {
|
||||
todo(false, "Got the 'recording-device-events' notification twice, likely because of bug 962719");
|
||||
}
|
||||
yield expectObserverCalled("recording-window-ended");
|
||||
yield expectNoObserverCalled();
|
||||
yield checkNotSharing();
|
||||
}
|
||||
}
|
||||
|
||||
];
|
||||
|
|
|
@ -128,6 +128,10 @@ this.webrtcUI = {
|
|||
}
|
||||
},
|
||||
|
||||
forgetStreamsFromBrowser: function(aBrowser) {
|
||||
this._streams = this._streams.filter(stream => stream.browser != aBrowser);
|
||||
},
|
||||
|
||||
showSharingDoorhanger: function(aActiveStream, aType) {
|
||||
let browserWindow = aActiveStream.browser.ownerGlobal;
|
||||
if (aActiveStream.tab) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче