Closed Bug 971495 Opened 10 years ago Closed 10 years ago

[System2] Instantiable HardwareButton

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alive, Assigned: timdream)

References

Details

Attachments

(1 file)

We need hardware_button.js to be instantiable and let bootstrap or its parent module to instantiate it.
Also jsdoc + unit test improvement wanted.
Assignee: nobody → timdream
Comment on attachment 8376091 [details] [review]
mozilla-b2g:master PR#16280

Alive, need your feedback on this.

What I did:

-- jshint
-- convert HardwareButtons to a construction function
-- convert all the states to construction functions
-- create an instance (with XXX) at the bottom
-- mark unresolved dependency (ScreenManager) with XXX
-- fire() -> publish()
-- explicit start() and stop()

What to do:

-- manual tests
-- jsdoc
-- unit tests
Attachment #8376091 - Flags: feedback?(alive)
Comment on attachment 8376091 [details] [review]
mozilla-b2g:master PR#16280

https://github.com/mozilla-b2g/gaia/pull/16280?w=1 will be more more helpful for reading.
Attachment #8376091 - Flags: feedback?(alive) → feedback+
nit: We should separate HardwareButtonState and HardwareButtonStateManager to 2 files in the following.
Highly recommended: Let HardwareButton(StateManager/StateMachine) to instantiate the states instead of instantiating every time the state is changed.
Comment on attachment 8376091 [details] [review]
mozilla-b2g:master PR#16280

Completed:

-- jsdocs
-- manual tests

WIP:

-- unit tests
Attachment #8376091 - Flags: feedback?(alive)
Comment on attachment 8376091 [details] [review]
mozilla-b2g:master PR#16280

++
Attachment #8376091 - Flags: feedback?(alive) → feedback+
Comment on attachment 8376091 [details] [review]
mozilla-b2g:master PR#16280

Unit test added :)
Attachment #8376091 - Flags: review?(alive)
Comment on attachment 8376091 [details] [review]
mozilla-b2g:master PR#16280

Nice work, thanks!
Attachment #8376091 - Flags: review?(alive) → review+
Squashed and waiting for Travis.
Fixed, green, and landed: https://github.com/mozilla-b2g/gaia/commit/5b6e783573a1e03426f104b1460f1a47b4bc4052
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Depends on: 988832
Depends on: 989974
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: