Closed Bug 971520 Opened 10 years ago Closed 10 years ago

[System2] Instantiable NfcManager

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v2.1 fixed)

RESOLVED FIXED
2.1 S3 (29aug)
Tracking Status
b2g-v2.1 --- fixed

People

(Reporter: alive, Assigned: tauzen)

References

Details

Attachments

(1 file)

We need nfc_manager.js to be instantiable and let bootstrap or its parent module to instantiate it.
Also jsdoc + unit test improvement wanted.
I would like to work on this once I'll finish the test cases for NfcManager. Please assign this to me.
Depends on: 1006375
Assignee: nobody → kmioduszewski
Depends on: 1037337
Comment on attachment 8472969 [details] [review]
pull-request-971520.txt

Hi Alive, could review this?

I'm currently doing self-initilization. I can move the regular initilization code to bootstrap.js or perform lazy loading and initialization of NfcManager when nfc.enabled setting is switched on for the first time. 

Could you suggest a solution? If we would go with lazy-loading, where should the code be placed?

Is it ok to land this and file a separate bug for the initialization?
Attachment #8472969 - Flags: review?(alive)
Comment on attachment 8472969 [details] [review]
pull-request-971520.txt

Please instantiate a new NFC manager in unit test (in setup function) each time you need it.

The spirit of instantiable singleton is we have different copy and states in each new object. If you override window.NfcManager with new NfcManager then nothing is changed in this patch..
Attachment #8472969 - Flags: review?(alive)
Comment on attachment 8472969 [details] [review]
pull-request-971520.txt

Addressed the comments, and as discussed on IRC moved initialisation to bootstrap.js and modified tests accordingly.
Attachment #8472969 - Flags: review?(alive)
Comment on attachment 8472969 [details] [review]
pull-request-971520.txt

r=me
Attachment #8472969 - Flags: review?(alive) → review+
Keywords: checkin-needed
Master: https://github.com/mozilla-b2g/gaia/commit/9bc229db6db17b92bae8dc5e8d1160cba632ec52
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S3 (29aug)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: