Backed out changeset 3193763d0a3b (
bug 1069222) for M1 test failures
--- a/content/media/test/test_imagecapture.html
+++ b/content/media/test/test_imagecapture.html
@@ -33,17 +33,16 @@ function gcTest(track) {
};
imageCapture.onerror = function(error) {
ok(false, "takePhoto failure in gc testing");
reject();
};
imageCapture.takePhoto();
}
- info("Call gc ");
SpecialPowers.gc();
});
}
// Continue calling takePhoto() in rapid succession.
function rapidTest(track) {
return new Promise(function(resolve, reject) {
var imageCapture = new ImageCapture(track);
@@ -107,30 +106,18 @@ function trackTest(track) {
track.enabled = false;
imageCapture.takePhoto()
});
}
function init() {
return new Promise(function(resolve, reject) {
- var constraints;
- if (SpecialPowers.Services.appinfo.name == "B2G") {
- info("B2G ImageCapture test");
- // Reduce repeat count due to b2g emulator is very slow.
- repeat = 20;
- // Use gonk camera, MedieEngine will be the backend of ImageCapture.
- constraints = {video: true};
- } else {
- // use fake camera, MediaStreamGraph will be the backend of ImageCapture.
- constraints = {video: true, fake: true}
- }
-
window.navigator.mozGetUserMedia(
- constraints,
+ {video: true, fake: true},
function(stream) {
var track = stream.getVideoTracks()[0];
resolve(track);
},
function(err) {
reject(err);
}
);
@@ -145,21 +132,20 @@ function start() {
info("ImageCapture blob test.");
return blobTest(track);
}).then(function(track) {
info("ImageCapture rapid takePhoto() test.");
return rapidTest(track);
}).then(function(track) {
info("ImageCapture multiple instances test.");
return gcTest(track);
- }).then(SimpleTest.finish);
+ }).then(function() {
+ SimpleTest.finish();
+ });
}
-SimpleTest.requestCompleteLog();
SimpleTest.waitForExplicitFinish();
+SpecialPowers.pushPrefEnv({"set": [["dom.imagecapture.enabled", true]]}, start);
-SpecialPowers.pushPrefEnv({"set": [["dom.imagecapture.enabled", true],
- ["media.navigator.permission.disabled", true]
- ]}, start);
</script>
</pre>
</body>
</html>