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)
Firefox
Search
Tracking
()
RESOLVED
FIXED
Firefox 53
| Tracking | Status | |
|---|---|---|
| firefox53 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
Details
(Whiteboard: [fxsearch])
Attachments
(1 file, 5 obsolete files)
|
12.16 KB,
patch
|
mak
:
review+
|
Details | Diff | 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)
Comment 1•11 years ago
|
||
I think we should also make head_search use updateAppInfo() from AppInfo.jsm rather than implementing its own?
| Assignee | ||
Comment 2•11 years ago
|
||
(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.
| Assignee | ||
Comment 3•11 years ago
|
||
Use updateAppInfo in head_search.js.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b53bafcde5b8
Attachment #8560302 -
Attachment is obsolete: true
Attachment #8560302 -
Flags: review?(mak77)
Attachment #8561148 -
Flags: review?(mak77)
Comment 4•11 years ago
|
||
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
Updated•11 years ago
|
Assignee: nobody → hiikezoe
Status: NEW → ASSIGNED
Updated•11 years ago
|
Flags: needinfo?(hiikezoe)
| Assignee | ||
Comment 5•11 years ago
|
||
(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)
| Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #5)
> as far as I can push it on try server.
I *did* try once.
Comment 7•11 years ago
|
||
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)
| Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8561148 -
Attachment is obsolete: true
Attachment #8561148 -
Flags: review?(mak77)
Attachment #8563053 -
Flags: review?(mak77)
| Assignee | ||
Comment 9•11 years ago
|
||
Tried on all platforms for safety.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1dc2aa825590
Attachment #8563055 -
Flags: review?(mak77)
Comment 10•11 years ago
|
||
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 11•11 years ago
|
||
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+
| Assignee | ||
Comment 12•11 years ago
|
||
Use defineLazyServiceGetter.
Seems good.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6ba001718f51
Attachment #8563053 -
Attachment is obsolete: true
Attachment #8564932 -
Flags: review?(mak77)
Comment 13•11 years ago
|
||
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.
Comment 14•11 years ago
|
||
(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 15•11 years ago
|
||
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+
Comment 16•11 years ago
|
||
(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)
Comment 17•10 years ago
|
||
Is there a reason why this hasn't landed?
Flags: needinfo?(mak77)
Flags: needinfo?(hiikezoe)
Comment 18•10 years ago
|
||
looks like we lost it in the middle of bugzilla, we should check if it bitrotted, and send it to Try.
| Assignee | ||
Comment 19•10 years ago
|
||
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)
Updated•10 years ago
|
Priority: -- → P4
Whiteboard: [fxsearch]
Updated•10 years ago
|
Rank: 45
Comment 20•9 years ago
|
||
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)
| Assignee | ||
Comment 21•9 years ago
|
||
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)
| Assignee | ||
Comment 22•9 years ago
|
||
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 23•9 years ago
|
||
I think you meant to link this Try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f8913a376a915ea9fd2547ba2bbf6bd3eaf0669e
Comment 24•9 years ago
|
||
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+
Comment 25•9 years ago
|
||
Pushed by hiikezoe@mozilla-japan.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/21846361193f
Remove updateAppInfo from search xpcshell tests. r=mak
| Assignee | ||
Comment 26•9 years ago
|
||
(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!
Comment 27•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
You need to log in
before you can comment on or make changes to this bug.
Description
•