Introduce a use case wrapper to consolidate the use cases in HomeActivity#load
Categories
(Firefox for Android :: Homepage, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox138 | --- | fixed |
People
(Reporter: gl, Assigned: gl)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
HomeActivity#openToBrowserAndLoad is an use case with a lot of different consumers (Searchfox) that handles the action of loading a search term or URL in the browser and navigating to the Browser screen.
As part of Homepage as a New Tab, we are looking to take advantage of this to centralized all actions around loading the provided URL or search term in a tab with HomeActivity#load except we would want to open within the the current tab instead of a new tab as part of the new navigation model. This allows us to have a single use case for handling this action and can ensure the behaviour is consistent throughout the application.
As part of this bug, we are refactoring HomeActivity#load to utilize the existing of UseCases patterns so that we can move the logic away from the HomeActivity (Rationale: Separation of Concerns from Activity and Fragment). This new use case will be a wrapper around the existing search and session use cases that are invoked by load(), and serves as the decision tree between loading a URL or search term depending on the parameters that are provided.
This initial refactor will allow us to more easily add unit testing of the HomeActivity#load functionality ensuring that we have appropriate test coverage for this important action.
The long term goal here would be to completely remove the usage of HomeActivity#openToBrowserAndLoad in favour of the new UseCases introduced here and navigation would be handle in their respective controller or navigation middleware. However, we will not be looking to remove all the usages in this initial refactor and subsequent followup bugs will be filed.
The task here is to do the following:
- Refactors the use cases usage in HomeActivity#load into a centralized
UseCaseswrapper. - Migrate an existing consumer of HomeActivity#openToBrowserAndLoad to the new
UseCaseswrapper.
| Assignee | ||
Comment 1•8 months ago
|
||
| Assignee | ||
Comment 2•8 months ago
|
||
- Refactors the use cases usage in HomeActivity#load into a centralized UseCases wrapper.
- This allows for unit testing and provides a starting point for moving the HomeActivity#openBrowserAndLoad logic out of the HomeActivity.
| Assignee | ||
Comment 3•8 months ago
|
||
| Assignee | ||
Comment 4•8 months ago
|
||
| Assignee | ||
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
| Assignee | ||
Updated•7 months ago
|
Comment 6•7 months ago
|
||
| bugherder | ||
| Assignee | ||
Updated•7 months ago
|
Comment 8•7 months ago
|
||
Backed out for causing Fenix failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/8e7e2ea9dd4a4596b2ba9973ad9aa9812c2f832d
Failure log: https://treeherder.mozilla.org/logviewer?job_id=501002576&repo=autoland&lineNumber=25589
Comment 10•7 months ago
|
||
Relanded this, for the fenix failures Bug 1956618 was filed.
Updated•7 months ago
|
Comment 11•7 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/eb2c3644f040
https://hg.mozilla.org/mozilla-central/rev/dd6c1b9e56fe
https://hg.mozilla.org/mozilla-central/rev/8bef67ab32b6
Description
•