Closed Bug 1130284 Opened 11 years ago Closed 9 years ago

Remove redundant updateAppInfo from test files in toolkit/components/search/tests/xpcshell/.

Categories

(Firefox :: Search, defect, P4)

defect

Tracking

()

RESOLVED FIXED
Firefox 53
Tracking Status
firefox53 --- fixed

People

(Reporter: hiro, Assigned: hiro)

Details

(Whiteboard: [fxsearch])

Attachments

(1 file, 5 obsolete files)

Attached patch remove_updateAppInfo.patch (obsolete) — Splinter Review
Each test in toolkit/components/search/tests/xpcshell/ invokes updateAppInfo() to register application info but the registration is done in head_search.js. So all of updateAppInfo should be removed. https://treeherder.mozilla.org/#/jobs?repo=try&revision=02a455d05893
Attachment #8560302 - Flags: review?(mak77)
I think we should also make head_search use updateAppInfo() from AppInfo.jsm rather than implementing its own?
(In reply to Marco Bonardo [::mak] (needinfo? me) from comment #1) > I think we should also make head_search use updateAppInfo() from AppInfo.jsm > rather than implementing its own? I was going to fix such change as another bug, but yes you are right. It's much better to change it in this bug.
Attached patch remove_updateAppInfo v2 (obsolete) — Splinter Review
Attachment #8560302 - Attachment is obsolete: true
Attachment #8560302 - Flags: review?(mak77)
Attachment #8561148 - Flags: review?(mak77)
Comment on attachment 8561148 [details] [diff] [review] remove_updateAppInfo v2 Review of attachment 8561148 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/components/search/tests/xpcshell/head_search.js @@ +52,3 @@ > var isChild = XULRuntime.processType == XULRuntime.PROCESS_TYPE_CONTENT; > > +updateAppInfo(XULAppInfo); Is there a valid reason we can't just rely on the default APP_INFO object exposed by AppInfo.jsm if you don't pass into your custom object? (thus just invoking updateAppInfo()) To me looks like it could just work, you would not even need to edit search.json cause the platformBuildID of that object is the same
Assignee: nobody → hiikezoe
Status: NEW → ASSIGNED
Flags: needinfo?(hiikezoe)
(In reply to Marco Bonardo [::mak] (needinfo? me) from comment #4) > Comment on attachment 8561148 [details] [diff] [review] > remove_updateAppInfo v2 > > Review of attachment 8561148 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: toolkit/components/search/tests/xpcshell/head_search.js > @@ +52,3 @@ > > var isChild = XULRuntime.processType == XULRuntime.PROCESS_TYPE_CONTENT; > > > > +updateAppInfo(XULAppInfo); > > Is there a valid reason we can't just rely on the default APP_INFO object > exposed by AppInfo.jsm if you don't pass into your custom object? (thus just > invoking updateAppInfo()) Yeah, I was actually going to just invoking updateAppInfo without any argument. But after landing bug 1121340, I think using the default APP_INFO in AppInfo.jsm will break some xpcshell tests. Though it did not break anything for now actually as far as I can push it on try server.
Flags: needinfo?(hiikezoe)
(In reply to Hiroyuki Ikezoe (:hiro) from comment #5) > as far as I can push it on try server. I *did* try once.
well, the only thing that bug changed is OS: XULRuntime.OS, this change can very likely be ported to AppInfo.jsm... would be nice if you could try doing that and getting a Try run (running only linux/windows xpcshell should be enough)
Attachment #8561148 - Attachment is obsolete: true
Attachment #8561148 - Flags: review?(mak77)
Attachment #8563053 - Flags: review?(mak77)
Comment on attachment 8563053 [details] [diff] [review] Part 0: Use XULRuntime.OS instead of "XPCShell" for default app info Review of attachment 8563053 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/modules/AppInfo.jsm @@ +25,5 @@ > inSafeMode: false, > logConsoleErrors: true, > + OS: Components.classesByID["{95d89e3e-a169-41a3-8e56-719978e15b12}"] > + .getService(Ci.nsIXULRuntime) > + .OS, Rather than getting service everytime OS is requested, I'd put an XPCOMUtils.defineGetter(this, "XULRuntime", () => Components.classesByID["{95d89e3e-a169-41a3-8e56-719978e15b12}"] .getService(Ci.nsIXULRuntime)); Or even better, I'm not sure why this is not using Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime) ... Could you please check if a simple XPCOMUtils.defineLazyServiceGetter(this, "XULRuntime", "@mozilla.org/xre/app-info;1", "nsIXULRuntime"); would do?
Attachment #8563053 - Flags: review?(mak77) → feedback+
Comment on attachment 8563055 [details] [diff] [review] Part 1: Remove updateAppInfo from search xpcshell tests Review of attachment 8563055 [details] [diff] [review]: ----------------------------------------------------------------- yeah, this part looks good now!
Attachment #8563055 - Flags: review?(mak77) → review+
Attachment #8563053 - Attachment is obsolete: true
Attachment #8564932 - Flags: review?(mak77)
Components.classesByID was used in the search tests because they overrode the default @mozilla.org/xre/app-info;1 implementation, but wanted to reflect a property of the default one.
(In reply to :Gavin Sharp [email: gavin@gavinsharp.com] from comment #13) > Components.classesByID was used in the search tests because they overrode > the default @mozilla.org/xre/app-info;1 implementation, but wanted to > reflect a property of the default one. but looks like that doesn't happen anymore, are we fine removing that complication?
Flags: needinfo?(gavin.sharp)
Comment on attachment 8564932 [details] [diff] [review] Part 0: Use XULRuntime.OS instead of "XPCShell" for default app info v2 Review of attachment 8564932 [details] [diff] [review]: ----------------------------------------------------------------- This looks good to me, by the time we define APP_INFO, XULRuntime is the default, it should work.
Attachment #8564932 - Flags: review?(mak77) → review+
(In reply to Marco Bonardo [::mak] -- currently sick :( (delayed answers) from comment #14) > but looks like that doesn't happen anymore, are we fine removing that > complication? It looks like the result of this patch is that things are re-ordered such that the OS value is obtained before the override occurs, which seems fine.
Flags: needinfo?(gavin.sharp)
Is there a reason why this hasn't landed?
Flags: needinfo?(mak77)
Flags: needinfo?(hiikezoe)
looks like we lost it in the middle of bugzilla, we should check if it bitrotted, and send it to Try.
Thanks Florian, I did miss this bug. Unfortunately 'Part 0' patch breaks test_pac_generator.js on B2G. There needs to be more work.... https://treeherder.mozilla.org/#/jobs?repo=try&revision=bb3e08443c81
Flags: needinfo?(mak77)
Flags: needinfo?(hiikezoe)
Priority: -- → P4
Whiteboard: [fxsearch]
Rank: 45
Hiro, since b2g is no longer being maintained and is being removed (bug 1306391), could you try these again and see if we can land them?
Flags: needinfo?(hikezoe)
arai did almost the same thing in bug 1153978. As far as I can tell what we still need to do is just dropping updateAppInfo() in each test files. I did push a try with that now: https://treeherder.mozilla.org/#/jobs?repo=try&revision=42a46226db9be905258d3c4e9d635f9d3dcea4b3 Let's see if it works.
Flags: needinfo?(hikezoe)
I'd like to ask review again just in case. Marco?
Attachment #8563055 - Attachment is obsolete: true
Attachment #8564932 - Attachment is obsolete: true
Attachment #8825613 - Flags: review?(mak77)
Comment on attachment 8825613 [details] [diff] [review] Remove updateAppInfo from search xpcshell tests (updated) Review of attachment 8825613 [details] [diff] [review]: ----------------------------------------------------------------- Patch looks ok and Try looks good. Thank you!
Attachment #8825613 - Flags: review?(mak77) → review+
Pushed by hiikezoe@mozilla-japan.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/21846361193f Remove updateAppInfo from search xpcshell tests. r=mak
(In reply to Marco Bonardo [::mak] from comment #23) > I think you meant to link this Try: > https://treeherder.mozilla.org/#/ > jobs?repo=try&revision=f8913a376a915ea9fd2547ba2bbf6bd3eaf0669e Right! It was wrong pasting. Thanks!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: