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)

defect
Not set
normal

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.
Blocks: 993188
Attached file pull request (deleted) —
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Attachment #8409880 - Flags: review?(poirot.alex)
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 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)
No, not yet. We first need to clean the API (bug 993188), and that requires us to clean up current use cases.
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+
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!
Blocks: 1000593
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S1 (9may)
No longer blocks: 993188
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 → ---
(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.
Flags: needinfo?(anthony)
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)
Attached file pull request with a test (deleted) —
(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)
Flags: needinfo?(anthony)
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)
Depends on: 1000806
Attachment #8416370 - Flags: review?(anthony)
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+
Status: REOPENED → RESOLVED
Closed: 11 years ago10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: