Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #22868 from mpizza/Bug_1053614_release_status_bug
Browse files Browse the repository at this point in the history
Bug 1053614 - [woodduck] repeatedly enter and leave camera app, then hig...h chance camera will be black screen when entering camera.
  • Loading branch information
dmarcos authored and rvandermeulen committed Aug 19, 2014
1 parent 287a2c7 commit 3cff628
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/camera/js/lib/camera/camera.js
Expand Up @@ -655,8 +655,8 @@ Camera.prototype.release = function(done) {
function onSuccess() {
debug('successfully released');
self.ready();
self.emit('released');
self.releasing = false;
self.emit('released');
done();
}

Expand Down
11 changes: 11 additions & 0 deletions apps/camera/test/unit/lib/camera/camera_test.js
Expand Up @@ -961,6 +961,17 @@ suite('lib/camera/camera', function() {
});
});

test('Should change camera.releasing status before released fired',
function(done) {
var self = this;
this.camera.releasing = true;
this.camera.on('released', function() {
assert.isFalse(self.camera.releasing);
done();
});
this.camera.release();
});

test('Should call the callback with an error argument', function(done) {
this.mozCamera.release = sinon.stub();
this.mozCamera.release.callsArgWithAsync(1, 'error');
Expand Down

0 comments on commit 3cff628

Please sign in to comment.