The following code will support environments with, or without `navigator.mozCameras`.

```js
navigator.mozCameras = navigator.mozCameras || {
  getListOfCameras: function() {},
  getCamera: function() {}
};

// Stub all the methods on navigator.mozCameras
this.sandbox.stub(navigator, 'mozCameras');

// Define what each function should do when called.
navigator.mozCameras.getListOfCameras.returns([]);
```