Hopefully this works. The comments appear to be missing on github for some
odd reason.

Concerning ScreenManager, it's actually a MockScreenManager, not
ScreenManager itself (this is the nfc_manager_test.js, I can move it to
screen manager).


On Wed, Mar 19, 2014 at 8:51 PM, Alive.Kuo <notifications@github.com> wrote:

> In apps/system/test/unit/nfc_manager_test.js:
>
> > @@ -161,4 +169,51 @@ suite('Nfc Utility functions', function() {
> >
> >    });
> >
> > +  // This mainly only tests that ScreenManager.called is modified
> > +  // as a side effect from calls in Technology Discovered and Lost.
> > +  suite('NFC Manager Power Handling Functions', function() {
> > +    var aUUID = '{4f4787c4-51f0-4288-8caf-55d440303b0b}';
> > +    var stubHandleEvent;
> > +
> > +    setup(function() {
> > +      ScreenManager.called = false;
>
> This is not the way to test.
> You just need to test if the events are dispatched instead of rewriting
> screen manager here.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/mozilla-b2g/gaia/pull/17091/files#r10782026>
> .
>