Bug 1219711 - Remove fakeness from webrtc tests. r=jib

--HG--
extra : commitid : ACLnd4zWe6Y
extra : rebase_source : ebd721157d80959d6946966508e98bd9eb382ca9
This commit is contained in:
Andreas Pehrson 2015-11-05 17:15:51 +08:00
parent 3affebad3f
commit bba51fc7ab
11 changed files with 25 additions and 29 deletions

View File

@ -20,7 +20,6 @@ function identityPcTest(remoteOptions) {
}], [remoteOptions || {
audio: true,
video: true,
fake: true,
peerIdentity: id1
}]);
test.pcLocal.setIdentityProvider('test1.example.com', 'idp.js');

View File

@ -20,8 +20,7 @@ function theTest() {
// side is isolated anyway.
identityPcTest({
audio: true,
video: true,
fake: true
video: true
});
}
runNetworkTest(theTest);

View File

@ -46,27 +46,24 @@ runTest(() =>
.then(() => mustSucceed("unknown plain deviceId on video",
() => navigator.mediaDevices.getUserMedia({
video: { deviceId: "unknown9qHr8B0JIbcHlbl9xR+jMbZZ8WyoPfpCXPfc=" },
fake: true,
})))
.then(() => mustSucceed("unknown plain deviceId on audio",
() => navigator.mediaDevices.getUserMedia({
audio: { deviceId: "unknown9qHr8B0JIbcHlbl9xR+jMbZZ8WyoPfpCXPfc=" },
fake: true,
})))
.then(() => mustFailWith("unknown exact deviceId on video",
"OverconstrainedError", "deviceId",
() => navigator.mediaDevices.getUserMedia({
video: { deviceId: { exact: "unknown9qHr8B0JIbcHlbl9xR+jMbZZ8WyoPfpCXPfc=" } },
fake: true,
})))
.then(() => mustFailWith("unknown exact deviceId on audio",
"OverconstrainedError", "deviceId",
() => navigator.mediaDevices.getUserMedia({
audio: { deviceId: { exact: "unknown9qHr8B0JIbcHlbl9xR+jMbZZ8WyoPfpCXPfc=" } },
fake: true,
})))
// Check the special case of no devices found (these prefs override fake).
.then(() => pushPrefs(["media.audio_loopback_dev", "none"],
// Check the special case of no devices found.
.then(() => pushPrefs(["media.navigator.streams.fake", false],
["media.audio_loopback_dev", "none"],
["media.video_loopback_dev", "none"]))
.then(() => navigator.mediaDevices.enumerateDevices())
.then(devices => ok(devices.length === 0, "No devices found")));

View File

@ -25,8 +25,11 @@
var testVideo = createMediaElement('video', 'testVideo');
return Promise.resolve()
.then(() => getUserMedia({ video: { mediaSource: "browser",
scrollWithPage: true } }))
.then(() => getUserMedia({
video: { mediaSource: "browser",
scrollWithPage: true },
fake: false
}))
.then(stream => {
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return playback.playMediaWithDeprecatedStreamStop(false);
@ -38,7 +41,8 @@
viewportOffsetY: 0,
viewportWidth: 100,
viewportHeight: 100
}
},
fake: false
}))
.then(stream => {
var playback = new LocalMediaStreamPlayback(testVideo, stream);

View File

@ -16,16 +16,13 @@ createHTML({ title: "Test getUserMedia constraints", bug: "882145" });
var tests = [
// Each test here tests a different constraint or codepath.
{ message: "unknown required constraint on video ignored",
constraints: { video: { somethingUnknown: { exact: 0 } },
fake: true },
constraints: { video: { somethingUnknown: { exact: 0 } } },
error: null },
{ message: "unknown required constraint on audio ignored",
constraints: { audio: { somethingUnknown: { exact: 0 } },
fake: true },
constraints: { audio: { somethingUnknown: { exact: 0 } } },
error: null },
{ message: "audio overconstrained by facingMode ignored",
constraints: { audio: { facingMode: { exact: 'left' } },
fake: true },
constraints: { audio: { facingMode: { exact: 'left' } } },
error: null },
{ message: "full screensharing requires permission",
constraints: { video: { mediaSource: 'screen' } },
@ -51,8 +48,7 @@ var tests = [
constraints: { },
error: "NotSupportedError" },
{ message: "Success-path: optional video facingMode + audio ignoring facingMode",
constraints: { fake: true,
audio: { mediaSource: 'microphone',
constraints: { audio: { mediaSource: 'microphone',
facingMode: 'left',
foo: 0,
advanced: [{ facingMode: 'environment' },
@ -66,7 +62,7 @@ var tests = [
{ bar: 0 }] } },
error: null },
{ message: "legacy facingMode ignored",
constraints: { video: { mandatory: { facingMode: 'left' } }, fake: true },
constraints: { video: { mandatory: { facingMode: 'left' } } },
error: null },
];

View File

@ -13,7 +13,7 @@ createHTML({
});
function theTest() {
function testPeerIdentityConstraint(withConstraint) {
var config = { audio: true, video: true, fake: true };
var config = { audio: true, video: true };
if (withConstraint) {
config.peerIdentity = 'user@example.com';
}

View File

@ -65,7 +65,7 @@ runNetworkTest(function() {
is(v2.currentTime, 0, "v2.currentTime is zero at outset");
// not testing legacy gUM here
navigator.mediaDevices.getUserMedia({ fake: true, video: true, audio: true })
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then(stream => pc1.addStream(v1.mozSrcObject = stream))
.then(() => pcall(pc1, pc1.createOffer))
.then(offer => pcall(pc1, pc1.setLocalDescription, offer))

View File

@ -36,7 +36,7 @@
is(v2.currentTime, 0, "v2.currentTime is zero at outset");
navigator.mediaDevices.getUserMedia({ fake: true, video: true, audio: true })
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then(stream => pc1.addStream(v1.srcObject = stream))
.then(() => pc1.createOffer({})) // check that createOffer accepts arg.
.then(offer => pc1.setLocalDescription(offer))

View File

@ -30,7 +30,7 @@
var newTrack;
var audiotrack;
return navigator.mediaDevices.getUserMedia({video:true, audio:true, fake:true})
return navigator.mediaDevices.getUserMedia({video:true, audio:true})
.then(newStream => {
window.grip = newStream;
newTrack = newStream.getVideoTracks()[0];
@ -112,7 +112,8 @@
var sourceNode = test.audioCtx.createOscillator();
sourceNode.type = 'sine';
// We need a frequency not too close to the fake audio track (1kHz).
// We need a frequency not too close to the fake audio track
// (440Hz for loopback devices, 1kHz for fake tracks).
sourceNode.frequency.value = 2000;
sourceNode.start();
@ -157,7 +158,7 @@
is(e.name, "InvalidParameterError",
"addTrack existing track should fail");
}
return navigator.mediaDevices.getUserMedia({video:true, fake: true})
return navigator.mediaDevices.getUserMedia({video:true})
.then(differentStream => {
var track = differentStream.getVideoTracks()[0];
try {

View File

@ -21,7 +21,7 @@
var oldstream = test.pcLocal._pc.getLocalStreams()[0];
var oldtrack = oldstream.getVideoTracks()[0];
var sender = test.pcLocal._pc.getSenders()[0];
return navigator.mediaDevices.getUserMedia({video:true, fake:true})
return navigator.mediaDevices.getUserMedia({video:true})
.then(newstream => {
var newtrack = newstream.getVideoTracks()[0];
return test.pcLocal.senderReplaceTrack(0, newtrack, newstream.id);

View File

@ -48,7 +48,7 @@ runNetworkTest(function () {
pc2 = new RTCPeerConnection();
// Test success callbacks (happy path)
navigator.mozGetUserMedia({video:true, fake: true}, function(video1) {
navigator.mozGetUserMedia({video:true}, function(video1) {
pc1.addStream(video1);
pc1.createOffer(function(offer) {
pc1.setLocalDescription(offer, function() {