Closed
Bug 1249259
Opened 9 years ago
Closed 9 years ago
Puppeteer is using deprecated Places API
Categories
(Testing :: Firefox UI Tests, defect)
Testing
Firefox UI Tests
Tracking
(firefox48 fixed)
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: mak, Assigned: whimboo)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
removeAllPages should be replaced with History.jsm::clear (async), since the former is deprecated.
Bookmarks should use async Bookmarks.jsm API too, but the old API has not been deprecated yet.
Assignee | ||
Comment 1•9 years ago
|
||
Thank you for the heads-up. The History.jsm (resource://gre/modules/History.jsm) change is clear, but which Bookmark code do you mean exactly? Everything in that module which handles bookmarks?
https://dxr.mozilla.org/mozilla-central/source/testing/puppeteer/firefox/firefox_puppeteer/api/places.py
Reporter | ||
Comment 2•9 years ago
|
||
anything using bs and nsINavBookmarksService should insteaf use PlacesUtils.bookmarks.XXX where XXX is the APIs exposed by resource://gre/modules/Bookmarks.jsm
Also History.jsm should be used through the PlacesUtils.history. accessor.
Assignee | ||
Comment 3•9 years ago
|
||
This patch exchanges all old and deprecated API calls with the ones in PlacesUtils. As a side-effect we can also condense some other code by using promises.
Review commit: https://reviewboard.mozilla.org/r/38797/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/38797/
Attachment #8728114 -
Flags: review?(mjzffr)
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8728114 [details]
MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
Marco, it would be great if you can give feedback. Just in case I missed something or did something wrong.
Attachment #8728114 -
Flags: feedback?(mak77)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Attachment #8728114 -
Flags: review?(mjzffr)
Comment on attachment 8728114 [details]
MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
https://reviewboard.mozilla.org/r/38797/#review35623
I don't feel comfortable reviewing this patch. Perhaps :mak should review rather than give feedback.
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8728114 [details]
MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/38797/diff/1-2/
Attachment #8728114 -
Attachment description: MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?maja_zf → MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
Attachment #8728114 -
Flags: feedback?(mak77) → review?(mak77)
Assignee | ||
Comment 7•9 years ago
|
||
https://reviewboard.mozilla.org/r/38797/#review35623
Good idea. I updated the mozreview request to make him the reviewer of this patch.
Reporter | ||
Updated•9 years ago
|
Attachment #8728114 -
Flags: review?(mak77)
Reporter | ||
Comment 8•9 years ago
|
||
Comment on attachment 8728114 [details]
MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
https://reviewboard.mozilla.org/r/38797/#review35901
I think you misunderstood my comment, likely cause I didn't explain it well.
We have 2 bookmarking APIs:
1. a synchronous one using ids, nsINavBookmarksService, also exposed from PlacesUtils.bookmarks.
2. an asynchronous one using GUIDs, exposed from PlacesUtils.bookmarks.
Both work, but we want internal code to use the new asynchronous API as far as possible and we'll migrate to that. The new API uses promises.
For example in this case instead of getBookmarkIdsForURI and getFolderIdForItem you could just do (in a task, but you can use plain promises)
let folderGuids = []
yield PlacesUtils.bookmarks.fetch({url: "your_url"}, bm => folderGuids.push(bm.parentGuid));
Atm, most of the new API documentation is directly in http://mxr.mozilla.org/mozilla-central/source/toolkit/components/places/Bookmarks.jsm
Now, I don't know if you can just move this code to use guids. So, for now it'd also be fine to take the patch as-is and do the bookmarking conversion work apart. The primary reason I filed this bug is to get rid of RemoveAllPages() from Places in this version
Let me know how you intend to proceed, the patch looks globally good, the bookmarks work can happen separately. I'm fine either way.
::: testing/puppeteer/firefox/firefox_puppeteer/api/places.py:36
(Diff revision 2)
> let uri = ios.newURI(url, null, null);
You may want to import NetUtil and use NetUtil.newURI(url);
If you'd use the new API, you could just pass a string or an URL object...
::: testing/puppeteer/firefox/firefox_puppeteer/api/places.py:106
(Diff revision 2)
> options.resultType = options.RESULTS_AS_URI;
this should be the default so likely you don't need to set it.
Assignee | ||
Comment 9•9 years ago
|
||
https://reviewboard.mozilla.org/r/38797/#review35901
> You may want to import NetUtil and use NetUtil.newURI(url);
> If you'd use the new API, you could just pass a string or an URL object...
Nice! Good to know that we do not need that anymore.
> this should be the default so likely you don't need to set it.
Indeed. I removed that line.
Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8728114 [details]
MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/38797/diff/2-3/
Attachment #8728114 -
Flags: review?(mak77)
Assignee | ||
Comment 11•9 years ago
|
||
Maja, in case I'm already out when this patch gets (hopefully) a r+, may you be able to land it for me? Thanks.
Flags: needinfo?(mjzffr)
Reporter | ||
Updated•9 years ago
|
Attachment #8728114 -
Flags: review?(mak77) → review+
Reporter | ||
Comment 12•9 years ago
|
||
Comment on attachment 8728114 [details]
MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
https://reviewboard.mozilla.org/r/38797/#review40051
nice!
::: testing/puppeteer/firefox/firefox_puppeteer/api/places.py:98
(Diff revision 3)
> let urls = [];
>
> - let options = hs.getNewQueryOptions();
> - options.resultType = options.RESULTS_AS_URI;
> + Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
> +
> + let options = PlacesUtils.history.getNewQueryOptions();
> + // options.resultType = options.RESULTS_AS_URI;
I guess you wanted to remove this?
Assignee | ||
Comment 13•9 years ago
|
||
https://reviewboard.mozilla.org/r/38797/#review40051
> I guess you wanted to remove this?
Totally! Will be fixed in the next version.
Assignee | ||
Comment 14•9 years ago
|
||
Comment on attachment 8728114 [details]
MozReview Request: Bug 1249259 - Update Firefox puppeteer for deprecated places API. r?mak
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/38797/diff/3-4/
Assignee | ||
Comment 15•9 years ago
|
||
Maja, Autoland should take of the landing now.
Flags: needinfo?(mjzffr)
Comment 16•9 years ago
|
||
Comment 17•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•