bug 862883 - Enable webrtc mochitests on FxAndroid. r=gcp

This commit is contained in:
Jason Smith 2013-05-02 10:33:15 -07:00
parent 4d19f23bce
commit 25ae945858
31 changed files with 42 additions and 52 deletions

View File

@ -111,31 +111,20 @@ function getUserMedia(constraints, onSuccess, onError) {
*
* @param {Function} aCallback
* Test method to execute after initialization
* @param {Boolean} desktopSupportedOnly
* Specifies if the test currently is known to work on desktop only
*/
function runTest(aCallback, desktopSupportedOnly) {
function runTest(aCallback) {
SimpleTest.waitForExplicitFinish();
// If this is a desktop supported test and we're on android or b2g,
// indicate that the test is not supported and skip the test
if(desktopSupportedOnly && (navigator.userAgent.indexOf('Android') > -1 ||
navigator.platform === '')) {
ok(true, navigator.userAgent + ' currently not supported');
SimpleTest.finish();
} else {
SpecialPowers.pushPrefEnv({'set': [
['media.peerconnection.enabled', true],
['media.navigator.permission.denied', true]]
}, function () {
try {
aCallback();
}
catch (err) {
unexpectedCallbackAndFinish(new Error)(err);
}
});
}
SpecialPowers.pushPrefEnv({'set': [
['media.peerconnection.enabled', true],
['media.navigator.permission.disabled', true]]
}, function () {
try {
aCallback();
}
catch (err) {
unexpectedCallbackAndFinish(new Error)(err);
}
});
}
/**

View File

@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=781534
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=781534
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -35,7 +35,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=781534
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -77,7 +77,7 @@ runTest(function () {
});
SimpleTest.finish();
}, false);
});
</script>
</pre>

View File

@ -49,7 +49,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -39,7 +39,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -38,7 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -39,7 +39,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -32,7 +32,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
audioStreamPlayback.playMediaWithStreamStop(false, SimpleTest.finish,
unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -32,7 +32,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
streamPlayback.playMediaWithStreamStop(false, SimpleTest.finish,
unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -32,7 +32,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
videoStreamPlayback.playMediaWithStreamStop(false, SimpleTest.finish,
unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -45,7 +45,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822109
}, unexpectedCallbackAndFinish(new Error));
}, unexpectedCallbackAndFinish(new Error));
}, true);
});
</script>
</pre>

View File

@ -20,7 +20,7 @@
test = new PeerConnectionTest();
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -22,7 +22,7 @@
test.setMediaConstraints([{audio: true}, {video: true}],
[{audio: true}, {video: true}]);
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -22,7 +22,7 @@
test.setMediaConstraints([{audio: true}, {video: true}],
[{audio: true}, {video: true}]);
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -20,7 +20,7 @@
test = new PeerConnectionTest();
test.setMediaConstraints([{video: true}], [{video: true}]);
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -22,7 +22,7 @@
pc = null;
SimpleTest.finish();
}, true);
});
</script>
</pre>
</body>

View File

@ -65,7 +65,7 @@
pcs = null;
SimpleTest.finish();
}, true);
});
</script>
</pre>
</body>

View File

@ -85,7 +85,7 @@
test.setMediaConstraints([{audio: true}], [{audio: true}]);
test.chain.append(steps);
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -37,7 +37,7 @@
}, function (err) {
croak("createOffer failed: " + err);
}, { mandatory: { OfferToReceiveAudio: true} });
}, true);
});
</script>
</pre>
</body>

View File

@ -56,7 +56,7 @@
pconnect = null;
pconnects = null;
SimpleTest.finish();
}, true);
});
</script>
</pre>
</body>

View File

@ -112,7 +112,7 @@
test.setMediaConstraints([{audio: true, video: true}], [ ]);
test.chain.replaceAfter("PC_LOCAL_GUM", steps);
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -68,7 +68,7 @@
runTest(function () {
testCreateAnswerError();
}, true);
});
</script>
</pre>
</body>

View File

@ -18,7 +18,7 @@
var test = new PeerConnectionTest();
test.setOfferConstraints({ mandatory: { OfferToReceiveAudio: true } });
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -18,7 +18,7 @@
var test = new PeerConnectionTest();
test.setOfferConstraints({ mandatory: { OfferToReceiveVideo: true } });
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -21,7 +21,7 @@
OfferToReceiveAudio: true
}});
test.run();
}, true);
});
</script>
</pre>
</body>

View File

@ -64,7 +64,7 @@
}, getFail(new Error));
throw new Error("Expected");
});
}, 1);
});
function finish() {
window.onerror = oldOnError;

View File

@ -205,6 +205,7 @@
"dom/file/test/test_write_read_data.html":"",
"dom/imptests/editing/conformancetest/test_event.html":"",
"dom/imptests/editing/conformancetest/test_runtest.html":"",
"dom/media/tests/mochitest":"",
"dom/mobilemessage/tests/test_sms_basics.html":"",
"dom/network/tests/test_networkstats_basics.html":"",
"dom/permission/tests/test_permission_basics.html":"",