Backed out changeset 4056345284df (bug 1046341) for B2G ICS Emulator Debug m7 test failure

This commit is contained in:
Carsten "Tomcat" Book 2014-07-31 11:52:52 +02:00
Родитель 860326fad9
Коммит 1d18fdbd48
2 изменённых файлов: 15 добавлений и 56 удалений

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

@ -234,7 +234,6 @@ GonkCameraHardware::Connect(mozilla::nsGonkCameraControl* aTarget, uint32_t aCam
nsresult rv = cameraHardware->Init();
if (NS_FAILED(rv)) {
DOM_CAMERA_LOGE("Failed to initialize camera hardware (0x%X)\n", rv);
cameraHardware->Close();
return nullptr;
}

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

@ -27,64 +27,24 @@ var initialConfig = {
}
};
var tests = [
{
name: "init-failure",
key: "init-failure",
func: function testInitFailure(test) {
function onSuccess(camera, config) {
ok(false, "onSuccess called incorrectly");
camera.release();
test.next();
}
function onError(error) {
ok(true, "onError called correctly on init failure");
test.next();
}
info("Running test: init-failure");
navigator.mozCameras.getCamera(whichCamera, initialConfig, onSuccess, onError);
}
},
/* This test case (init-success) *must* follow the preceeding test case
(init-failure) in order for the desired condition to be verified */
{
name: "init-success",
key: "",
func: function(test) {
function onSuccess(camera, config) {
ok(true, "onSuccess called correctly");
camera.release();
test.next();
}
function onError(error) {
ok(false, "onError called incorrectly: " + error);
test.next();
}
info("Running test: init-success");
navigator.mozCameras.getCamera(whichCamera, initialConfig, onSuccess, onError)
}
}
];
var testGenerator = function() {
for (var i = 0; i < tests.length; ++i ) {
yield tests[i];
}
}();
function end() {
CameraTest.end();
}
CameraTest.begin("hardware", function(test) {
CameraTest.next = function() {
try {
var t = testGenerator.next();
test.set(t.key, t.func.bind(undefined, CameraTest));
} catch(e) {
if (e instanceof StopIteration) {
} else {
throw e;
}
test.set("init-failure", function(type) {
function onSuccess(camera, config) {
ok(false, "onSuccess called incorrectly");
camera.release();
test.done(end);
}
};
CameraTest.next();
function onError(error) {
ok(true, "onError called correctly on init failure");
test.done(end);
}
info("Running test: " + type);
navigator.mozCameras.getCamera(whichCamera, initialConfig, onSuccess, onError);
});
});
</script>