mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 976544 - Intermittent | browser_get_user_media.js | Unexpected Exception: TypeError: PopupNotifications.panel.firstChild is null, r=Gijs.
This commit is contained in:
parent
de3682eb87
commit
6e23fd0ee3
@ -77,13 +77,20 @@ function promiseMessage(aMessage, aAction) {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function promisePopupNotification(aName) {
|
||||
|
||||
function promisePopupNotification(aName, aShown) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
waitForCondition(() => PopupNotifications.getNotification(aName),
|
||||
// If aShown is true, the notification is expected to be opened by
|
||||
// default and we wait for the panel to be populated; for dismissed
|
||||
// notifications, we are happy as soon as we find the icon.
|
||||
waitForCondition(() => PopupNotifications.getNotification(aName) &&
|
||||
(!aShown || PopupNotifications.panel.firstChild),
|
||||
() => {
|
||||
ok(!!PopupNotifications.getNotification(aName),
|
||||
aName + " notification appeared");
|
||||
if (aShown)
|
||||
ok(PopupNotifications.panel.firstChild, "notification panel populated");
|
||||
deferred.resolve();
|
||||
}, "timeout waiting for popup notification " + aName);
|
||||
|
||||
@ -205,7 +212,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(true, true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(true, true);
|
||||
|
||||
yield promiseMessage("ok", () => {
|
||||
@ -229,7 +236,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(true);
|
||||
|
||||
yield promiseMessage("ok", () => {
|
||||
@ -252,7 +259,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(false, true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(false, true);
|
||||
|
||||
yield promiseMessage("ok", () => {
|
||||
@ -275,7 +282,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(true, true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(true, true);
|
||||
|
||||
// disable the camera
|
||||
@ -306,7 +313,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(true, true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(true, true);
|
||||
|
||||
// disable the microphone
|
||||
@ -337,7 +344,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(true, true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(true, true);
|
||||
|
||||
// disable the camera and microphone
|
||||
@ -366,7 +373,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(true, true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(true, true);
|
||||
|
||||
yield promiseMessage("error: PERMISSION_DENIED", () => {
|
||||
@ -387,7 +394,7 @@ let gTests = [
|
||||
content.wrappedJSObject.requestDevice(true, true);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
checkDeviceSelectors(true, true);
|
||||
|
||||
yield promiseMessage("ok", () => {
|
||||
@ -424,15 +431,15 @@ let gTests = [
|
||||
{
|
||||
desc: "getUserMedia prompt: Always/Never Share",
|
||||
run: function checkRememberCheckbox() {
|
||||
let elt = id => document.getElementById(id);
|
||||
|
||||
function checkPerm(aRequestAudio, aRequestVideo, aAllowAudio, aAllowVideo,
|
||||
aExpectedAudioPerm, aExpectedVideoPerm, aNever) {
|
||||
yield promiseNotification("getUserMedia:request", () => {
|
||||
content.wrappedJSObject.requestDevice(aRequestAudio, aRequestVideo);
|
||||
});
|
||||
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
|
||||
let elt = id => document.getElementById(id);
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
|
||||
let noAudio = aAllowAudio === undefined;
|
||||
is(elt("webRTC-selectMicrophone").hidden, noAudio,
|
||||
@ -519,6 +526,10 @@ let gTests = [
|
||||
info("audio+video, user denies audio, grants video, " +
|
||||
"expect video perm set to allow, audio perm set to deny.");
|
||||
yield checkPerm(true, true, false, true, false, true);
|
||||
|
||||
// reset the menuitems to have no impact on the following tests.
|
||||
elt("webRTC-selectMicrophone-menulist").value = 0;
|
||||
elt("webRTC-selectCamera-menulist").value = 0;
|
||||
}
|
||||
},
|
||||
|
||||
@ -545,7 +556,7 @@ let gTests = [
|
||||
if (aExpectStream === undefined) {
|
||||
// Check that we get a prompt.
|
||||
yield promiseNotification("getUserMedia:request", gum);
|
||||
yield promisePopupNotification("webRTC-shareDevices");
|
||||
yield promisePopupNotification("webRTC-shareDevices", true);
|
||||
|
||||
// Deny the request to cleanup...
|
||||
yield promiseMessage("error: PERMISSION_DENIED", () => {
|
||||
|
Loading…
Reference in New Issue
Block a user