Commit Graph

109 Commits (990bfa7e6dd5894d61473a41da6129e6947974e2)

Author SHA1 Message Date
MarcLeclair 990bfa7e6d
16900 make navgraph inflation asynchronous (#18889)
* For #16900: implement async navgraph inflation

For #16900: removed nav graph from xml

For #16900: inflate navGraph programatically

For #16900: Made NavGraph inflation asynchronous

For #16900: Changed to block with runBlocking

For #16900: Refactored blocking call into a function

For 16900: NavGraph inflation is now async

We now attach the nav graph (or check if its attached) on every nav call ( an extension function for NavController).
This is done by checking the value of the job stored in PerfNavController.map which keeps track of the job with the NavController as a Key.
If the job hasn't been completed, it will block the main thread until the job is done. The job itself is responsible for attaching the navgraph
to the navcontroller (and the inflation of the latter too)

For 16900: rebased upstream master

For 16900: Rebase on master

For #16900: Fixed Async Navgraph navigation per review comments.

1)The Asynchronous method is now found in NavGraphProvider.kt. It creates a job on the IO dispatcher
2)The Job is tracked through a WeakHashMap from Controller --> NavGraph
3)The Coroutine scope doesn't use MainScope() anymore
4)The Coroutine is cancelled if the Activity is destroyed
5)The tests mockk the blockForNavGraphInflation method through the FenixReoboelectricTestApplication instead of calling the mock every setup()

For #16900: inflateNavGraphAsync now takes navController

For #16900: Pass lifecycleScope to NavGraphProvider

For #16900: removed unused mock

For #16900: Added linter rules for navigate calls

We need linting rules to make sure no one calls the NavController.navigate() methods

For #16900: Added TestRule to help abstract the mocks in the code

For 16900: Fix linting problems

For #16900: Cleaned duplicated code in tests

For #16900: cleaned up NavGraphTestRule for finished test

For #16900: had to revert an accidentally edited file

For #16900: rebased master

* For #16900: Review nits for async navgraph

This is composed of squash commits, the original messages can be found below:

-> DisableNavGraphProviderAssertionRule + kdoc.

Use test rule in RobolectricApplication.

Fix failing CrashReporterControllerTest

Fix blame by -> navigate in tests.

This commit was generated by the following commands only:
```
find app/src/test -type f -exec sed -i '' "/import org.mozilla.fenix.ext.navigateBlockingForAsyncNavGraph/d" {} \;
find app/src/test -type f -exec sed -i "" "s/navigateBlockingForAsyncNavGraph/navigate/g" {} \;
git checkout app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
```

Fix various blame

This is expected to be squashed into the first commit so, if so, it'd
fix the blame.

Move test rule to helpers pkg.

add missing license header

Add import change I missed

fix unused imports

Replace robolectricTestrunner with test rule.

Improve navGraphProvider docs

Remove unnecessary rule as defined by robolectric.

add clarifying comment to robolectric

remove unnecessary space

* For #16900: nit fixes for MozillaNavigateCheck and lint fixes

3 squash commits:
 *Changed violation message and fixed the lint rule for MozillaNavigateCheck
 *Added suppression to NavController.kt
 *Fixed detekt violations

* For 16900: Fixed failing tests

Co-authored-by: Michael Comella <michael.l.comella@gmail.com>
3 years ago
mcarare ba218e638b For #18375: Add experiment for set default browser New Tab card. 3 years ago
Mihai Adrian Carare ccfb275b03
For #17800 - Request desktop site from home screen. (#18653) 3 years ago
Kershan 02d70d3837
For #18453 - Show SUMO for default browser deeplink on Android <N
Lower Android versions don't offer the possibility of opening system settings
at a specific preference. In this cases we already shown a sumo article
detailing the manual steps each user is expected to perform to change the
system set default browser.
3 years ago
Mihai Adrian Carare a539f69cb2
For #18260 - Add pin to default sites. (#18618) 3 years ago
Arturo Mejia 869c99afaa For #15372 Optimize the order and messages of onboarding cards 3 years ago
Mugurell cc2ba4ba97
For #18585 - Don't use hardcoded String values in Onboarding unit test (#18597)
Test if the welcome message has the expected structure and uses the expected
String values, not what the string values are.
3 years ago
Roger Yang 27e52b7e3d
Closes #17956: Add top site telemetry to available search engines (#18129) 3 years ago
Christian Sadilek dc002f0508 Remove Session[Manager] references from Fennec intent processors 3 years ago
Sebastian Kaspari 9b65e63422 Closes #18006: DefaultSessionControlControllerTest: Correctly unmock SearchStateKt class.
The test class left SearchStateKt mocked and caused other tests to fail intermittently when
running after it.
3 years ago
Codrut Topliceanu d56b4a2b92
For #17418 - Added telemetry for Google Default Top Site (#17637)
* For #17418 - Adds channel "ts" to TrackKey

This is used to track if the `InContentTelemetry` is a result of the user using the Google Top Site. It looks for `&channel=ts` within the uri.

* For #17418 - Adds TopSite PerformedSearch back in

* For #17418 - Check now looks for equality with GOOGLE_URL

* For #17418 - Adds test for topSite changes
3 years ago
Roger Yang 8dfa4525ca
Fix OpenSpecificTabIntentProcessorTest to remove AbstractMediaService (#17955) 3 years ago
Christian Sadilek 88facc4608 Closes #17889: Wrong tab selected/reloaded when restored from collection 3 years ago
Roger Yang 993cf74e72
Closes #17174: Remove the New Media Session API Feature Flag (#17863) 3 years ago
Gabriel Luong a3d401a3b7
For #17418 - Add event ping telemetry for the Google Top Site click (#17862)
Co-authored-by: codrut.topliceanu <codrut.topliceanu@softvision.ro>
Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>
3 years ago
Roger Yang d434ff13a5
For #17092: Dismiss toolbar menu when configuration change occurs (#17682) 3 years ago
Mihai Adrian Carare 8993a0acb2
For #17655: Do not pass threshold if showTopFrecentSites is false. (#17657)
* For #17655: Do not pass threshold if showTopFrecentSites is false.

* For #17655: Add unit tests for getTopSitesConfig.
3 years ago
Christian Sadilek 87d6f32374 Refactor HomeFragment to use browser store 3 years ago
Gabriel Luong 70dc975299
For #17304 - Implement top site search engine attribution (#17580) 3 years ago
ekager 083fe26f57 For #17542 - Removes flash on renaming top site and fixes title not being updated 3 years ago
Christian Sadilek d8c5f8887a Refactor OpenSpecificTabIntentProcessor to use browser store 3 years ago
mcarare 8fa83a7bab For #10417: Improve reload collection tab testing. 3 years ago
mcarare edcee71287 For #17400: Select tab opened from collection. 3 years ago
Sebastian Kaspari d2b8decaeb Switch to new feature-tab-collections API. 4 years ago
ekager 1ca34a2bc9 For #16807 - Make sure there's only one instance of search dialog 4 years ago
Christian Sadilek faf765a57d Update IntentProcessors after breaking API change 4 years ago
Roger Yang 2ff7ba75c7
Closes #16896: Integrate new MediaSession API to nightly or debug builds (#16909) 4 years ago
Elise Richards 948db6f77b
Reload restored tabs from collection (#16865) 4 years ago
Sebastian Kaspari 2b759e9d6f Integrate new search code from Android Components into Fenix. 4 years ago
ekager b7fe809ae4 For #16351 - Make homescreen interactive when search dialog is up 4 years ago
Mugurell 88bfaaabe7
For #6521 - Remove auto sigin onboarding card (#16315)
With the Fennec -> Fenix migration complete there is no other Mozilla
application that would serve as a custom account provider hence the automatic
signin would not be possible.
Make this more obvious by commenting out the code that would trigger an
onboarding banner for it but keep the code in the app for when #15694 would add
to Fenix the ability to serve as a custom account provider.
4 years ago
ekager 9bb3440fce No issue: Make sure we are cleaning up test coroutines 4 years ago
Mihai Adrian Carare 0ee7e1c28d
For # 15929: Remove the search widget discoverability experiment. (#16081)
* For #15929: Remove SearchWidgetCFR telemetry.

* For #15929: Remove SearchWidgetCFR and search widget experiment.

* For #15929: Remove unit tests references to search widget experiment.
4 years ago
Elise Richards 1adf467248
For #14280, #14743: Remove old search fragment (#15169)
* Remove search fragment

* Use new folder to search dialog

* Rebase and lint

* Update tests with search dialog nav directions

* Rename interactor to match naming convention. Remove old controller and point everything to the dialog controller.
4 years ago
Grisha Kruglov 71b51146cb Update breaking changes in the FxA/Sync integration 4 years ago
Sawyer Blatz 1f17371df6 For #14565: Add telemetry for top sites 4 years ago
Sören Hentzschel 81dd1a9192
For #8343, #9709 - replace "phone" with "device" in translations (#14083) 4 years ago
Tiger Oakes e067ad5363
For #8157: Redirect about:addons search (#13990) 4 years ago
Gabriel Luong 0cc1d32e56 For #10342 - Part 7: Fix TopSiteViewHolderTest and TopSiteItemViewHolderTest 4 years ago
Gabriel Luong 40120ac98f For #10342 - Part 5: Fix DefaultSessionControlControllerTest and DefaultBrowserToolbarControllerTest 4 years ago
ekager 655d2b8a88 For #12377 - Choice to hide no collections placeholder from homescreen 4 years ago
Elise Richards feae7fff2f
FNX-14498 ⁃ For #9487: improve fxa onboarding manual sign in card (#13317)
* Replace strings, add learn more, hook up button

* Constrain learn more and icon to the text

* View holder tests

* Lint

* Update homescreen ui test
4 years ago
Mugurell b993b94be1 For #12857 - Use Collection title when sharing tabs collection
Avoided passing the subject for sharing a collection of tabs in the ShareData
object since ShareData is part of a web standard.
4 years ago
Sebastian Kaspari 77263aad70 Validate deep links. 4 years ago
Mihai Eduard Badea 58e24b81aa For issue #12400 - Refresh swiped collection tab view
Item is now refreshed by calling notifyDataSetChanged on the adapter when the last tab from the collection has been swiped away and the user cancels the deletion by pressing the cancel button from the dialog.
Also added a "wasSwiped" flag to onCollectionRemoveTab in order to check if the tab was deleted from a swipe action and not by pressing the "X" button.
4 years ago
ekager e5e62fa79a For #6846: Added quick actions for nav bar in home 4 years ago
ekager 46511d6f8e For #10163 - Adds tab multiselect mode 4 years ago
Tiger Oakes 652af79e95
Migrate from Session.toTab to BrowserStore (#12221) 4 years ago
Tiger Oakes 9af167ba0a
Add tests for some classes in home/browser (#12837) 4 years ago
Tiger Oakes 8f5a37733d
Create ToolbarPosition enum (#12747) 4 years ago