Closed
Bug 583238
Opened 11 years ago
Closed 11 years ago
Investigate ways to pass more context to FAC.autoCompleteSearch
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mfinkle, Assigned: mfinkle)
Details
Attachments
(1 file, 1 obsolete file)
6.57 KB,
patch
|
mbrubeck
:
review+
|
Details | Diff | Splinter Review |
With e10s, we have problems passing the "field" param to FAC.autoCompleteSearch. We were passing a faked object that included a "maxLength" property for the default FAC service. Fennec now has it's own FAC override component (see bug 578691) and it would like to use more context from the field. We can try to make a fake nsIDOMHTMLInputElement, but we'll never be able to fully simulate the interface. We can try making a new param or a new method, that allows us to pass extra context.
Assignee | ||
Comment 1•11 years ago
|
||
From Mounir Lamouri: I quickly look at the patch (in bug 578691) and it looks like you get the type with getAttribute and then compares it to 'email' and 'tel' but the type attribute isn't case sensitive so type='EMAIL' should work too. You can use .type which returns the type in lower case but you will have to depend on bugs implementing that (should land for ff4). ----- So we could add .type to our fake object to get better support with very little effort.
Assignee | ||
Comment 2•11 years ago
|
||
This approach works well and is forward compatible
Assignee: nobody → mark.finkle
Attachment #461553 -
Flags: review?(21)
Assignee | ||
Comment 3•11 years ago
|
||
Now with more tests
Attachment #461553 -
Attachment is obsolete: true
Attachment #461614 -
Flags: review?(21)
Attachment #461553 -
Flags: review?(21)
Assignee | ||
Updated•11 years ago
|
Attachment #461614 -
Flags: review?(21) → review?(mbrubeck)
Comment 4•11 years ago
|
||
Comment on attachment 461614 [details] [diff] [review] patch 2 >+// In case there are real contacts that could mess up our test counts >+let preEmailCount = fac.autoCompleteSearch("email", "", null, null).matchCount; >+let prePhoneCount = fac.autoCompleteSearch("tel", "", null, null).matchCount; This looks fine, but would it be more robust to just remove the real contact provider for these tests, using |_contacts.providers = [];|? r=mbrubeck
Attachment #461614 -
Flags: review?(mbrubeck) → review+
Assignee | ||
Comment 5•11 years ago
|
||
(In reply to comment #4) > Comment on attachment 461614 [details] [diff] [review] > patch 2 > > >+// In case there are real contacts that could mess up our test counts > >+let preEmailCount = fac.autoCompleteSearch("email", "", null, null).matchCount; > >+let prePhoneCount = fac.autoCompleteSearch("tel", "", null, null).matchCount; > > This looks fine, but would it be more robust to just remove the real contact > provider for these tests, using |_contacts.providers = [];|? > > r=mbrubeck LOL! That was exactly my first approach. But then I worried about making _providers inaccessible, breaking these tests. So I switched to this way for now.
Assignee | ||
Comment 6•11 years ago
|
||
pushed: http://hg.mozilla.org/mobile-browser/rev/143255567eca
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•