Closed Bug 999569 Opened 10 years ago Closed 10 years ago

[NFC] Initialization test cases for NfcManager

Categories

(Firefox OS Graveyard :: NFC, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tauzen, Assigned: tauzen)

References

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36

Steps to reproduce:

Test cases which would test if NfcManager is being properly initialized  are required for proper testing. This should also lay some groundwork for future NfcManager tests.
Added init test suit with two test cases:
1. NfcManager listens on screenchange, lock, unlock events
2. SettingsListner callback nfc.enabled fired 

All tests can now use the following mocks 
- window.navigator.mozSetMessageHandler - lack of this was resulting in an error during NfcManager.init() which prevented the event listners from being set
- window.SettingsListner
- window.lockScreen
Assignee: nobody → kmioduszewski
Blocks: NFC-Gaia
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Hi, Krzysztof
For Gaia patches, we use Github.
You could send a PullRequest when your patch is ready,
and when you submit a PR, it would run some travis test, once the travis is green, you can send r? here (Bugzilla) to request for review.

Thanks
Ok, this is still work in progress. Latest version is available on my github https://github.com/tauzen/gaia/tree/Bug999569.
Attached file Pull Request
Attachment #8410429 - Attachment is obsolete: true
Attachment #8411774 - Flags: review?(allstars.chh)
Comment on attachment 8411774 [details] [review]
Pull Request

Forward r? to Alive, as he's the right guy to review changes in System app.
Attachment #8411774 - Flags: review?(allstars.chh) → review?(alive)
Comment on attachment 8411774 [details] [review]
Pull Request

r+ if the change is made per discussions.
Thank you for making this better.
Attachment #8411774 - Flags: review?(alive) → review+
I've made the discussed changes and added two new test cases to check if events are handled properly in handleEvent. I've modified previous tests to use this.sinon and removed calls to stub.restore(). Travis CI build passes. It would be good if you could take a look (at least at the new test cases).

We should consider refactoring NfcManage.handleEvent and NfcManager.isScreenUnlockAndEnabled, but I assume this should be done once locksreen.js is removed.
Flags: needinfo?(alive)
Basically OK. Thanks!
Flags: needinfo?(alive)
Keywords: checkin-needed
Blocks: 959059
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: