зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1665713 - pt2 - fix reviewbot whitespace issues. r=ng
These were originally masked due to an exception in tools/lint/file-whitespace.html for the directory dom/media/tests, but we don't need an exception for our new location (dom/media/webrtc/tests/mochitests) if we fix these 3 files. 2 files had bad line endings (Windows vs Unix): dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabled.html dom/media/webrtc/tests/mochitests/test_getUserMedia_cubebDisabledFakeStreams.html 1 file had trailing whitespace: dom/media/webrtc/tests/mochitests/test_peerConnection_threeUnbundledConnections.html Differential Revision: https://phabricator.services.mozilla.com/D90630
This commit is contained in:
Родитель
8bece4651b
Коммит
1d099767d3
|
@ -1,42 +1,42 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
createHTML({
|
||||
title: "getUserMedia with Cubeb Disabled Test",
|
||||
bug: "1443525"
|
||||
});
|
||||
/**
|
||||
* Run a test to verify we fail gracefully if we cannot fetch a cubeb context
|
||||
* during a gUM call.
|
||||
*/
|
||||
runTest(async function () {
|
||||
info("Get user media with cubeb disabled starting");
|
||||
// Push prefs to ensure no cubeb context and no fake streams.
|
||||
await pushPrefs(["media.cubeb.force_null_context", true],
|
||||
["media.navigator.permission.device", false],
|
||||
["media.navigator.streams.fake", false]);
|
||||
|
||||
// Request audio only, to avoid cams
|
||||
let constraints = {audio: true, video: false};
|
||||
let stream;
|
||||
try {
|
||||
stream = await getUserMedia(constraints);
|
||||
} catch (e) {
|
||||
// We've got no audio backend, so we expect gUM to fail.
|
||||
ok(e.name == "NotFoundError", "Expected NotFoundError due to no audio tracks!");
|
||||
return;
|
||||
}
|
||||
// If we're not on android we should not have gotten a stream without a cubeb context!
|
||||
ok(false, "getUserMedia not expected to succeed when cubeb is disabled, but it did!");
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
createHTML({
|
||||
title: "getUserMedia with Cubeb Disabled Test",
|
||||
bug: "1443525"
|
||||
});
|
||||
/**
|
||||
* Run a test to verify we fail gracefully if we cannot fetch a cubeb context
|
||||
* during a gUM call.
|
||||
*/
|
||||
runTest(async function () {
|
||||
info("Get user media with cubeb disabled starting");
|
||||
// Push prefs to ensure no cubeb context and no fake streams.
|
||||
await pushPrefs(["media.cubeb.force_null_context", true],
|
||||
["media.navigator.permission.device", false],
|
||||
["media.navigator.streams.fake", false]);
|
||||
|
||||
// Request audio only, to avoid cams
|
||||
let constraints = {audio: true, video: false};
|
||||
let stream;
|
||||
try {
|
||||
stream = await getUserMedia(constraints);
|
||||
} catch (e) {
|
||||
// We've got no audio backend, so we expect gUM to fail.
|
||||
ok(e.name == "NotFoundError", "Expected NotFoundError due to no audio tracks!");
|
||||
return;
|
||||
}
|
||||
// If we're not on android we should not have gotten a stream without a cubeb context!
|
||||
ok(false, "getUserMedia not expected to succeed when cubeb is disabled, but it did!");
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
createHTML({
|
||||
title: "getUserMedia fake stream with Cubeb Disabled Test",
|
||||
bug: "1443525"
|
||||
});
|
||||
/**
|
||||
* Run a test to verify we can still return a fake stream even if we cannot
|
||||
* get a cubeb context. See also Bug 1434477
|
||||
*/
|
||||
runTest(async function () {
|
||||
info("Get user media with cubeb disabled and fake tracks starting");
|
||||
// Push prefs to ensure no cubeb context and fake streams
|
||||
await pushPrefs(["media.cubeb.force_null_context", true],
|
||||
["media.navigator.streams.fake", true],
|
||||
['media.audio_loopback_dev', '']);
|
||||
let testAudio = createMediaElement('audio', 'testAudio');
|
||||
// Request audio only, to avoid cams
|
||||
let constraints = {audio: true, video: false};
|
||||
let stream;
|
||||
try {
|
||||
stream = await getUserMedia(constraints);
|
||||
} catch (e) {
|
||||
// We've got no audio backend, so we expect gUM to fail
|
||||
ok(false, `Did not expect to fail, but got ${e}`);
|
||||
return;
|
||||
}
|
||||
ok(stream, "getUserMedia should get a stream!");
|
||||
let playback = new MediaStreamPlayback(testAudio, stream);
|
||||
return playback.playMedia(false);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
createHTML({
|
||||
title: "getUserMedia fake stream with Cubeb Disabled Test",
|
||||
bug: "1443525"
|
||||
});
|
||||
/**
|
||||
* Run a test to verify we can still return a fake stream even if we cannot
|
||||
* get a cubeb context. See also Bug 1434477
|
||||
*/
|
||||
runTest(async function () {
|
||||
info("Get user media with cubeb disabled and fake tracks starting");
|
||||
// Push prefs to ensure no cubeb context and fake streams
|
||||
await pushPrefs(["media.cubeb.force_null_context", true],
|
||||
["media.navigator.streams.fake", true],
|
||||
['media.audio_loopback_dev', '']);
|
||||
let testAudio = createMediaElement('audio', 'testAudio');
|
||||
// Request audio only, to avoid cams
|
||||
let constraints = {audio: true, video: false};
|
||||
let stream;
|
||||
try {
|
||||
stream = await getUserMedia(constraints);
|
||||
} catch (e) {
|
||||
// We've got no audio backend, so we expect gUM to fail
|
||||
ok(false, `Did not expect to fail, but got ${e}`);
|
||||
return;
|
||||
}
|
||||
ok(stream, "getUserMedia should get a stream!");
|
||||
let playback = new MediaStreamPlayback(testAudio, stream);
|
||||
return playback.playMedia(false);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -112,7 +112,7 @@ runNetworkTest(async () => {
|
|||
const answerVideo = await pc2.createAnswer();
|
||||
const answerAudio = await pc3.createAnswer();
|
||||
|
||||
const answer = combineAnswer(answerAudio, combineAnswer(answerVideo, {}));
|
||||
const answer = combineAnswer(answerAudio, combineAnswer(answerVideo, {}));
|
||||
const fakeAnswer = answer.sessionSection.concat(answer.audioMsection, answer.videoMsection).join('\r\n');
|
||||
info("ANSWER: " + fakeAnswer);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче