Closed
Bug 999195
Opened 11 years ago
Closed 10 years ago
Clean up bootstrap mozL10n API use in Emergency Call
Categories
(Firefox OS Graveyard :: Gaia::Dialer, defect)
Firefox OS Graveyard
Gaia::Dialer
Tracking
(b2g-v2.0 fixed)
RESOLVED
FIXED
2.0 S1 (9may)
Tracking | Status | |
---|---|---|
b2g-v2.0 | --- | fixed |
People
(Reporter: zbraniecki, Assigned: zbraniecki)
References
Details
Attachments
(2 files)
Emergency call manually sets document's lang/dir and uses 'localized' event to initialize.
Instead it should use mozL10n.once.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Assignee | ||
Updated•11 years ago
|
Attachment #8409880 -
Flags: review?(poirot.alex)
Comment 2•11 years ago
|
||
Comment on attachment 8409880 [details]
pull request
Sorry, I'm only reviewer of the build system in Gaia.
Tim, it looks like you already reviewed some code in emergency.
Attachment #8409880 -
Flags: review?(poirot.alex) → review?(timdream)
Comment 3•11 years ago
|
||
Comment on attachment 8409880 [details]
pull request
I am setting r? flag to the original author.
Do we have a document on use cases of API methods for mozL10n?
Attachment #8409880 -
Flags: review?(timdream) → review?(gweng)
Assignee | ||
Comment 4•11 years ago
|
||
No, not yet. We first need to clean the API (bug 993188), and that requires us to clean up current use cases.
Comment 5•11 years ago
|
||
Comment on attachment 8409880 [details]
pull request
Tried on real device and have no errors and problems, and the tests are all passed, so there is the r+.
Attachment #8409880 -
Flags: review?(gweng) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 6•11 years ago
|
||
Not directly related to the bug, but...
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #3)
> Do we have a document on use cases of API methods for mozL10n?
I spent some time today putting together the following docs:
https://developer.mozilla.org/en-US/docs/Web/API/Navigator.mozL10n
https://developer.mozilla.org/en-US/docs/Web/API/L10n
It's a work in progress, but should be a good start!
Comment 7•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
status-b2g-v2.0:
--- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S1 (9may)
Comment 8•11 years ago
|
||
I had to back out this patch for three reasons, sorry.
https://github.com/mozilla-b2g/gaia/commit/49a096509f5ea53dbb18b7e0a51d1018900da499
1) It should be reviewed by a peer of the Dialer component.
2) It's missing new tests.
3) It's using function arrows for no reason.
Status: RESOLVED → REOPENED
Component: Gaia → Gaia::Dialer
Resolution: FIXED → ---
Assignee | ||
Comment 9•11 years ago
|
||
(In reply to Anthony Ricaud (:rik) from comment #8)
> 2) It's missing new tests.
We have tests for .once in l10n testsuite. Can you help me identify how you'd like the test for .once in the Emergency Call app to look like?
> 3) It's using function arrows for no reason.
Are arrow functions discouraged? I thought they will be encouraged over anonymous functions.
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(anthony)
Comment 10•11 years ago
|
||
Tests: We need to test that we wait for a mock of navigator.mozL10n to fire once before removing the hidden class.
Arrow function: I'm not sure what the general policy is for Gaia in general but in this case, there is no need for one since we don't use this.
Flags: needinfo?(anthony)
Assignee | ||
Comment 11•11 years ago
|
||
(In reply to Anthony Ricaud (:rik) (out until May 13th) from comment #10)
> Tests: We need to test that we wait for a mock of navigator.mozL10n to fire
> once before removing the hidden class.
Ok, I added this test. Let me know if that looks like the test you want to have here. (I find testing bootstrapping code non-trivial)
Attachment #8416370 -
Flags: feedback?(anthony)
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(anthony)
Comment 12•11 years ago
|
||
Comment on attachment 8416370 [details]
pull request with a test
The logic of the test looks ok (and I agree with you that keypad.js is currently annoying to test). I've left comments on the pull request to use mocksHelper and move the mocks to shared. I also think we should use sinon but that's up to you.
Attachment #8416370 -
Flags: feedback?(anthony) → feedback+
Flags: needinfo?(anthony)
Assignee | ||
Updated•11 years ago
|
Attachment #8416370 -
Flags: review?(anthony)
Comment 13•10 years ago
|
||
Comment on attachment 8416370 [details]
pull request with a test
Two very very small nits on github.
Otherwise, good to go!
Attachment #8416370 -
Flags: review?(anthony) → review+
Assignee | ||
Comment 14•10 years ago
|
||
Thanks for help!
Patch: https://github.com/mozilla-b2g/gaia/commit/a04cecbabe0af14c50fd275e3a3aca223e07a08c
Merge: https://github.com/mozilla-b2g/gaia/commit/356a468972cb2e29961aeb960c9adfa080651f9e
Status: REOPENED → RESOLVED
Closed: 11 years ago → 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•