Synchronous initialization of search service when handling open search tag

RESOLVED FIXED in Firefox 35



4 years ago
4 years ago


(Reporter: Margaret, Assigned: Margaret)


Firefox 35
Bug Flags:
in-testsuite +

Firefox Tracking Flags




(2 attachments)



4 years ago
I'm seeing this warning the first time I load a URL (testing in today's Nightly):

DEPRECATION WARNING: Search service falling back to synchronous initialization. This is generally the consequence of an add-on using a deprecated search service API.
You may find more details about this deprecation at:
jar:jar:file:///data/app/org.mozilla.fennec-1.apk!/assets/omni.ja!/components/nsSearchService.js 2802 SRCH_SVC__ensureInitialized
jar:jar:file:///data/app/org.mozilla.fennec-1.apk!/assets/omni.ja!/components/nsSearchService.js 3724 SRCH_SVC_getVisible
chrome://browser/content/browser.js 3734 Tab.prototype.handleEvent
null 0 null

I traced this back to this line:

We should find a way to do this asynchronously, especially as this could affect load times when loading an external URL on startup.
My bad, that should be passed as a callback to Will be an easy fix though.
Assignee: nobody → liuche


4 years ago
tracking-fennec: --- → ?

Comment 2

4 years ago
Created attachment 8483842 [details] [diff] [review]
Remove synchronous search service initialization

This makes me really want to fix bug 935259, but that's less important.
Assignee: liuche → margaret.leibovic
Attachment #8483842 - Flags: review?(liuche)
tracking-fennec: ? → 34+
Comment on attachment 8483842 [details] [diff] [review]
Remove synchronous search service initialization

Review of attachment 8483842 [details] [diff] [review]:

Attachment #8483842 - Flags: review?(liuche) → review+
Backed this out for a robocop test failure:
Flags: needinfo?(margaret.leibovic)

Comment 6

4 years ago
This is happening because testBrowserDiscovery expects the open search link to be parsed synchronously. 

To work around this, I added a line to testBrowserDiscovery to synchronously load the search service before starting the test, and that fixed things for me locally. Here's a try push:
Flags: needinfo?(margaret.leibovic)

Comment 7

4 years ago
Created attachment 8487302 [details] [diff] [review]
Load the search service before running open search discovery tests

This seems to solve the problem.

I made a few retriggers to make sure the green wasn't a fluke.
Attachment #8487302 - Flags: review?(mark.finkle)
Attachment #8487302 - Flags: review?(mark.finkle) → review+
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
You need to log in before you can comment on or make changes to this bug.