Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

In siteUtil.updateSiteFavicon use location cache #9279

Merged
merged 1 commit into from
Jun 7, 2017

Conversation

ayumi
Copy link
Contributor

@ayumi ayumi commented Jun 6, 2017

Fix #9276

Note: This slightly changes the function behavior because it removes use of normalizeUrl when comparing locations. By default the library removes www from URLs:

'https://www.example.com/about.html#test'
=> 'https://example.com/about.html#test'

We had been testing this case, assuming that we had both https://www.brave.com/ and https://brave.com, calling updateSiteFavicon with https://brave.com and expected both sites to be updated.

I don't think this case actually happens (please correct me if I'm wrong), and the siteKey cache does normalize location when setting and getting so it seems safe.

Auditors: @bsclifton @bbondy

Test Plan:

  1. load 10K bookmarks
  2. Enable bookmarks bar favicons via Preferences > General > "Bookmarks Bar" => "Text and Favicons".
  3. Create a bookmark folder.
  4. Navigate to https://archive.org
  5. Bookmark page.
  6. Navigate to https://wikipedia.org
  7. Bookmark page into the folder.
  8. Examine bookmarks toolbar; there should be favicons for archive and wikipedia.
  9. Open the Bookmarks Manager and confirm there are favicons.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

Related: #8541

Fix #9276

Auditors: @bsclifton @bbondy

Test Plan:
1. Enable bookmarks bar favicons via Preferences > General > "Bookmarks Bar" => "Text and Favicons".
2. Create a bookmark folder.
3. Navigate to https://archive.org
4. Bookmark page.
5. Navigate to https://wikipedia.org
6. Bookmark page into the folder.
7. Examine bookmarks toolbar; there should be favicons for archive and wikipedia.
8. Open the Bookmarks Manager and confirm there are favicons.
@ayumi ayumi requested review from bbondy and bsclifton June 6, 2017 01:33
@ayumi ayumi self-assigned this Jun 6, 2017
@ayumi ayumi added the perf label Jun 6, 2017
@luixxiul
Copy link
Contributor

luixxiul commented Jun 6, 2017

@ayumi just a head-up: could I know how this issue should solve #8541? I couldn't tell based on the STR in the 1st post.

@ayumi
Copy link
Contributor Author

ayumi commented Jun 6, 2017

@luixxiul I think STR would be to first load 10K bookmarks, then navigate some websites. The STR for #9276 is related.

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😄 One missing test might be to have a magnet link in the list of sites in the test (in case the code changes, it won't regress if the URL is parsed)

@bsclifton bsclifton merged commit a18a818 into master Jun 7, 2017
@bsclifton bsclifton deleted the fix/update-site-favicon-speed branch June 7, 2017 17:02
bsclifton added a commit that referenced this pull request Jun 7, 2017
In siteUtil.updateSiteFavicon use location cache
bsclifton added a commit that referenced this pull request Jun 7, 2017
In siteUtil.updateSiteFavicon use location cache
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants