Bug 1320994 - Remove chrome-test hacks that accomodated the misaligned MediaManager model. r=florian

MozReview-Commit-ID: BS693gGyVhm

--HG--
extra : rebase_source : ae85538f9150f8c272ca90ff43a9348b69f7bc22
This commit is contained in:
Andreas Pehrson 2017-04-07 15:30:43 +02:00
Родитель 5db9427abb
Коммит aee0a7853c
5 изменённых файлов: 14 добавлений и 27 удалений

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

@ -410,7 +410,7 @@ var gTests = [
yield check({video: true, audio: true});
info("Stop the camera, everything should stop.");
yield stopSharing("camera", false, true);
yield stopSharing("camera");
info("Now, share only the screen...");
indicator = promiseIndicatorWindow();
@ -423,7 +423,7 @@ var gTests = [
yield check({video: true, audio: true, screen: "Screen"});
info("Stop the camera, this should stop everything.");
yield stopSharing("camera", false, true);
yield stopSharing("camera");
}
},

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

@ -62,7 +62,7 @@ var gTests = [
SitePermissions.remove(null, "microphone", gBrowser.selectedBrowser);
// After closing all streams, gUM(audio+camera) causes a prompt.
yield closeStream(false, 0, 2);
yield closeStream();
promise = promisePopupNotificationShown("webRTC-shareDevices");
yield promiseRequestDevice(true, true);
yield promise;
@ -169,7 +169,7 @@ var gTests = [
yield checkSharingUI({audio: false, video: true});
// close all streams
yield closeStream(false, 0, 2);
yield closeStream();
}
},
@ -241,7 +241,7 @@ var gTests = [
yield checkSharingUI({audio: true, video: false});
// close all streams
yield closeStream(false, 0, 2);
yield closeStream();
}
}

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

@ -57,7 +57,7 @@ var gTests = [
yield expectObserverCalled("recording-device-events");
// close the stream
yield closeStream(false, "frame1", 2);
yield closeStream(false, "frame1");
}
},
@ -197,7 +197,7 @@ var gTests = [
yield expectObserverCalled("recording-window-ended");
// close the stream
yield closeStream(false);
yield closeStream();
SitePermissions.remove(null, "screen", gBrowser.selectedBrowser);
SitePermissions.remove(null, "camera", gBrowser.selectedBrowser);
SitePermissions.remove(null, "microphone", gBrowser.selectedBrowser);

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

@ -41,7 +41,6 @@ var gTests = [
yield Promise.all(promises);
promises = [promiseObserverCalled("recording-device-events"),
promiseObserverCalled("recording-device-events"),
promiseObserverCalled("recording-window-ended")];
yield BrowserTestUtils.closeWindow(win);
yield Promise.all(promises);

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

@ -215,7 +215,7 @@ function expectObserverCalled(aTopic) {
});
}
function expectNoObserverCalled(aIgnoreDeviceEvents = false) {
function expectNoObserverCalled() {
return new Promise(resolve => {
let mm = _mm();
mm.addMessageListener("Test:ExpectNoObserverCalled:Reply",
@ -225,15 +225,7 @@ function expectNoObserverCalled(aIgnoreDeviceEvents = false) {
if (!data[topic])
continue;
// If we are stopping tracks that were created from 2 different
// getUserMedia calls, the "recording-device-events" notification is
// fired twice on Windows and Mac, and intermittently twice on Linux.
if (topic == "recording-device-events" && aIgnoreDeviceEvents) {
todo(false, "Got " + data[topic] + " unexpected " + topic +
" notifications, see bug 1320994");
} else {
is(data[topic], 0, topic + " notification unexpected");
}
is(data[topic], 0, topic + " notification unexpected");
}
resolve();
});
@ -354,8 +346,7 @@ function getMediaCaptureState() {
});
}
function* stopSharing(aType = "camera", aShouldKeepSharing = false,
aExpectDoubleRecordingEvent = false) {
function* stopSharing(aType = "camera", aShouldKeepSharing = false) {
let promiseRecordingEvent = promiseObserverCalled("recording-device-events");
gIdentityHandler._identityBox.click();
let permissions = document.getElementById("identity-popup-permission-list");
@ -372,7 +363,7 @@ function* stopSharing(aType = "camera", aShouldKeepSharing = false,
if (!aShouldKeepSharing)
yield expectObserverCalled("recording-window-ended");
yield expectNoObserverCalled(aExpectDoubleRecordingEvent);
yield expectNoObserverCalled();
if (!aShouldKeepSharing)
yield* checkNotSharing();
@ -391,16 +382,13 @@ function promiseRequestDevice(aRequestAudio, aRequestVideo, aFrameId, aType,
});
}
function* closeStream(aAlreadyClosed, aFrameId, aStreamCount = 1) {
function* closeStream(aAlreadyClosed, aFrameId) {
yield expectNoObserverCalled();
let promises;
if (!aAlreadyClosed) {
promises = [];
for (let i = 0; i < aStreamCount; i++) {
promises.push(promiseObserverCalled("recording-device-events"));
}
promises.push(promiseObserverCalled("recording-window-ended"));
promises = [promiseObserverCalled("recording-device-events"),
promiseObserverCalled("recording-window-ended")];
}
info("closing the stream");