Commit Graph

46 Commits

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>
2021-04-13 20:48:45 -04:00
mcarare
ba218e638b For #18375: Add experiment for set default browser New Tab card. 2021-04-13 17:25:51 +03:00
Mihai Adrian Carare
ccfb275b03
For #17800 - Request desktop site from home screen. (#18653) 2021-03-30 16:12:46 -04:00
Roger Yang
27e52b7e3d
Closes #17956: Add top site telemetry to available search engines (#18129) 2021-03-19 10:53:36 -04:00
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.
2021-02-18 15:49:31 +01:00
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
2021-02-11 11:31:01 -05:00
Christian Sadilek
88facc4608 Closes #17889: Wrong tab selected/reloaded when restored from collection 2021-02-10 10:46:13 +01:00
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>
2021-02-05 12:06:32 -05:00
Christian Sadilek
87d6f32374 Refactor HomeFragment to use browser store 2021-01-26 10:08:02 +01:00
Gabriel Luong
70dc975299
For #17304 - Implement top site search engine attribution (#17580) 2021-01-22 14:23:46 -05:00
mcarare
8fa83a7bab For #10417: Improve reload collection tab testing. 2021-01-15 15:30:48 +02:00
mcarare
edcee71287 For #17400: Select tab opened from collection. 2021-01-15 15:30:48 +02:00
Sebastian Kaspari
d2b8decaeb Switch to new feature-tab-collections API. 2020-12-16 15:32:53 -05:00
Elise Richards
948db6f77b
Reload restored tabs from collection (#16865) 2020-12-07 11:32:27 -06:00
Sebastian Kaspari
2b759e9d6f Integrate new search code from Android Components into Fenix. 2020-11-20 17:45:45 +01:00
ekager
b7fe809ae4 For #16351 - Make homescreen interactive when search dialog is up 2020-11-18 13:53:33 -08:00
ekager
9bb3440fce No issue: Make sure we are cleaning up test coroutines 2020-10-29 18:57:23 -07:00
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.
2020-10-28 13:46:02 -07:00
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.
2020-09-24 15:46:42 -05:00
Sawyer Blatz
1f17371df6 For #14565: Add telemetry for top sites 2020-09-17 10:06:39 -07:00
Gabriel Luong
40120ac98f For #10342 - Part 5: Fix DefaultSessionControlControllerTest and DefaultBrowserToolbarControllerTest 2020-08-26 18:39:05 -04:00
ekager
655d2b8a88 For #12377 - Choice to hide no collections placeholder from homescreen 2020-08-24 16:48:50 -04:00
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.
2020-08-12 13:40:58 +03:00
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.
2020-07-31 12:48:32 -04:00
ekager
e5e62fa79a For #6846: Added quick actions for nav bar in home 2020-07-27 13:28:28 -04:00
ekager
46511d6f8e For #10163 - Adds tab multiselect mode 2020-07-24 18:18:26 -04:00
Tiger Oakes
652af79e95
Migrate from Session.toTab to BrowserStore (#12221) 2020-07-23 12:27:39 -07:00
Tiger Oakes
aa31eb0fa5
Fix failure in handleWhatsNewGetAnswersClicked (#12682) 2020-07-17 14:25:35 -07:00
Tiger Oakes
eed20b43b9
Test session control controller (#12652) 2020-07-17 13:07:01 -07:00
Tiger Oakes
4dd0c0f224
For #12457: Add MockK matcher for intents (#12612) 2020-07-16 15:05:01 -07:00
Tiger Oakes
d0e9f1f165
Update Kotlin dependency (#10806) 2020-07-15 18:02:58 -07:00
ValentinTimisica
4a93a41bb2 For #11763: Fixes unit tests 2020-07-06 17:06:10 -04:00
Jeff Boek
2861421312 For #11112 - Adds save tabs to collection button to the no collections message 2020-06-23 08:17:55 -07:00
Jeff Boek
52c2fdb310
Remove tab tray feature flag (#11176)
* For #11171 - Removes feature flag for the new tab tray

* For #11171 - Removes all tab references from homeFragment

* For #11171 - Fixes unit tests

* For #11171 - Gets UI tests to compile and HomeScreenTest to pass

* For #11171 - Fixes `deleteMultipleSelectionTest`

* For #11171 - Fixes `openHistoryItemInNewPrivateTabTest`

* For #11171 - Fixes `openHistoryInPrivateTabTest`

* For #11171 - Fixes `openHistoryInNewTabTest`

* For #11171 - Fixes `openNewPrivateTabTest`

* For #11171 - Fixes tabbedBrowsingTests

* For #11171 - Fixes SettingsPrivacyTest

* For #11171 - Fixes TopSitesTest

* For #11171 - Fixes lint errors

* Ignore
2020-06-05 12:59:08 -05:00
David Walsh
4fdac4d608
For 10734 - Open tab tray when collection is opened from Home (#10751)
* For 10734 - Open tab tray when collection is opened from Home

* Update to work with tab tray drawer
2020-05-28 10:22:12 -05:00
Sawyer Blatz
7067e5c000
For #8125: Add default top site telemetry (#10752) 2020-05-22 13:10:09 -07:00
ekager
c4e83367f6 For #6832 - Fix various fragment not attached to a context crashes 2020-04-22 20:56:35 -07:00
Mihai Adrian
dfded8e69c
For #9687: Refactor onboarding cards to follow app architecture (#9743)
* For #9687: Refactor onboarding cards to follow app architecture

* For #9687: Update unit test to new controller parameters
2020-04-06 11:00:47 -07:00
Sebastian Kaspari
02aabea14a Update to new feature-media API. 2020-03-29 23:13:13 -07:00
Arturo Mejia
7dff584b82 Remove @ObsoleteCoroutinesApi from tests 2020-03-18 17:25:51 -07:00
Sawyer Blatz
e96732604b For #167: Improves home to browser animation 2020-02-28 18:04:14 -07:00
mcarare
361e817fb1 For #6607 Update unit test to include parameter openSearchScreen 2020-02-28 13:21:22 -08:00
Emily Kager
39db8c9557
For #8470 - Fix Unit Tests MockKExceptions (#8471) 2020-02-17 17:13:25 -08:00
mcarare
372b1e7f0e For #6980: Update Private browsing card.
Added test to description.
Added link to settings.
Updated unit tests.
2020-02-13 14:13:57 -08:00
Marc Leclair
72007590f7 #7700 squash commit and fixing toolbar to switxh to top with coordinatorlayout 2020-02-05 16:40:41 -08:00
Gabriel
56b21426eb
For #5574 - Migrate SessionControl to LibState (#6651)
* For #5574 - Part 1: Port TabAction.SaveTabGroup to TabSessionInteractor and SessionControlController. (#6651)

- Introduces the TabSessionInteractor, SessionControlInteractor and SessionControlController classes.
- Removes the TabAction.SaveTabGroup.

* For #5574 - Part 2: Port TabAction.PrivateBrowsingLearnMore to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 3: Port TabAction.ShareTabs to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 4: Remove unused TabAction.Share and TabItemMenu (#6651)

In #2205, the tab overflow button was removed which would have shown the
TabItemMenu when clicked. So, we can remove TabItemMenu since it is not
used and as a result, we can also remove TabAction.Share since there are
no consumers.

* For #5574 - Part 5: Port TabAction.PlayMedia and TabAction.PauseMedia to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 6: Port TabAction.Select to TabSessionInteractor and SessionControlController (#6651)

* For #5574 - Part 7: Port Onboarding.Finish to OnboardingInteractor and SessionControlController (#6651)

* For #5574 - Part 8: Port TabAction.Close and TabAction.CloseAll to TabSessionInteractor and SessionControlController (#6651)

- Removes TabAction

* For #5574 - Part 9: Port CollectionAction.Delete to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 10: Port CollectionAction.ShareTabs to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 11: Port CollectionAction.AddTab and CollectionAction.Rename to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 12: Port CollectionAction.RemoveTab to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 13: Port CollectionAction.OpenTab to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 14: Port CollectionAction.CloseTabs to CollectionInteractor and SessionControlController (#6651)

* For #5574 - Part 15: Introduce a HomeFragmentStore (#6651)

- We will hook up the HomeFragmentStore in later parts.
- Removes List<Tab>.toSessionBundle(context: Context) since it is unused.

* For #5574 - Part 16: Port CollectionAction.Collapse and CollectionAction.Expand to CollectionInteractor and SessionControlController (#6651)

- We assume the store is hooked up to the SessionControlController in this part,
but this work will be done in a later part.
- Removes CollectionAction.

* For #5574 - Part 20: Remove the architecture module. (#6651)

* For #5574 - Part 17:  Remove duplicate subscribeToTabCollections in BrowserFragment.kt (#6651)

There is a duplicate call of subscribeToTabCollections() in both HomeFragment and BrowserFragment.
In this patch, we remove the call in BrowserFragment to avoid passing the HomeFragmentStore to
BrowserFragment in order to dispatch the CollectionsChange event.

* For #5574 - Part 18: Delete SessionControlComponent and fix TabCollection and Tab imports (#6651)

* For #5574 - Part 19: Use the new HomeFragmentStore in the HomeFragment (#6651)

- Renames SessionControlUIView to SessionControlView

* For #5574 - Part 21: Fix white screen on home fragment (#6651)

* For #5574 - Part 22: Fix formatting in SessionControlInteractor and replace See with @see in SessionControlController (#6651)

* For #5574 - Part 23: Move to metrics.track call to the beginning of handleCollectionRemoveTab (#6651)

This ensures that the metrics.track will be called immediately before the tab is removed from the collection.

* For #5574 - Part 24: Use the sessionManager getter in SessionControlController (#6651)

* For #5574 - Part 25: Use mapNotNull in List<Tab>.toSessionBundle (#6651)

* For #5574 - Part 26: Simplify closeTab and closeAllTabs functions by assigning a deletionJob constant (#6651)

* For #5574 - Part 27: Replace listOf() with emptyList() in removeAllTabsWithUndo (#6651)

* For #5574 - Part 28: Replace the Context parameter with the HomeActivity in SessionControlController (#6651)

* For #5574 - Part 29: Add test for HomeFragmentStore, DefaultSessionControlController and SessionControlInteractor (#6651)

* For #5574 - Removes running CI against the architecture debug build varient
2019-12-04 22:06:05 -05:00