Closed Bug 922006 Opened 11 years ago Closed 11 years ago

[Dialer] Refactor dialer.js for easier unit testing

Categories

(Firefox OS Graveyard :: Gaia::Dialer, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rexboy, Assigned: rexboy)

References

Details

Attachments

(1 file)

We have an initial version of unit test on dialer.js.
But since onload listener is included in dialer.js, we have to
expose the onload listener and remove the listener in unit test actively
to prevent unwanted initialization on KeypadManager that breaks unit test.

One possible solution is, as mentioned in Bug 903278 comment 22, to refactor
onload listener in each window to an independent js file to prevent unwanted
initialization.
Reset blocking flag (came from cloning)
blocking-b2g: koi+ → ---
Attached file patch
Onload listeners are refactored, See pull request for detail.

I tested with normal dialing/receiving/activity.
in my test by now launch time is not changing after applying this patch.
Specifically,
dialing out from contact spends about 3.7s (when dialer hasn't launched)
and 2.4s (when dialer has launched) both before and after applying the patch.
Please tell me if there are other performance metrics that need to pay attention.

Etienne may you review this patch?
This is not a blocker so we don't have to do it very eager though.
Attachment #8346490 - Flags: review?(etienne)
Comment on attachment 8346490 [details]
patch

r=me with a tiny nit.

This is a welcomed change, perfect for the beginning of a cycle :)
Also did some manual testing and found 0 issues, including playing with the dial activity and locked/unlocked incoming calls.

Cheers!
Attachment #8346490 - Flags: review?(etienne) → review+
Thanks for the reviewing and testing Etienne!

We can then start to add unit test for dialer.js in later commits.
merged after fixing the nit:
master
https://github.com/mozilla-b2g/gaia/commit/f1d060293091370d5315d01f4af91139dfcba0cb
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Assignee: nobody → rexboy
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: