Commit Graph

98 Commits (1f633edd7d4436f20ead4ba657b1284b94cca0c6)

Author SHA1 Message Date
Gabriel Luong 4f3e891484 For #24114 - Refactor ext/HomeFragmentStateTest to ext/AppStateTest 2 years ago
mcarare a9bb913653 For #19929: Use AC extension functions for window insets compat. 2 years ago
mcarare 47077fe2ec For #21743: Use isNumericAddress to validate Ipv4 and Ipv6 for SDK>=29. 2 years ago
Gabriel Luong d71e31188f For #23888 - Replace @color/white_color with @color/fx_mobile_[icon|text]_color_oncolor
@color/white_color and @color/fx_mobile_[icon|text]_color_oncolor are equivalent
2 years ago
MatthewTighe 2cc9ca3773 for #23069: add blocklist middleware for home 2 years ago
Gabriel Luong 37a0edceb6 For #23431 - Display the order of Contile Top Sites correctly 2 years ago
Roger Yang 047ec890b2 Closes #22550: Refactor search term tab grouping logic to rely on middleware 2 years ago
Grigory Kruglov 1b305c1398 For #22795: Stop trimming login origins on sorting
Due to the async nature (??) of the trimming code, this is causing severe performance issues
during search.

Looking back through commits, doesn't seem like there's a particularly good reason we were trimming here. All I could find is #9986 (comment) which is lacking explanation of why this is actually useful.

And currently, we're dealing with an origin (not a full url when this was initially written, I think), i.e. https://accounts.firefox.com vs https://accounts.firefox.com/signin. So, the suffix stripping isn't even doing much beyond removing com in vast majority of cases.

So, seems like all of this trimming stuff can be cleaned up.
2 years ago
Brais Gabín 7ec31a25c4 For #23142 - Fix license formatting in tests 2 years ago
mcarare cdbe7983f5 For #22879: Filter default engines when sending telemetry.
Filter out custom engines that are not well known search domains.
2 years ago
Grisha Kruglov 8de4c0b4db For #22569: Remove allopen plugin and Mockable annotations 3 years ago
Mugurell 548efefcbb For #22442 - Don't display individual tab if part of the Jump back in tabs group
We'll show as a recent tab the next most recent tab not part of the last active
search group.
3 years ago
Mugurell 685da115c9 For #22442 - Don't display history group if already in Jump back in 3 years ago
Mugurell f9b67091c6 For #22155 - New BrowserState.actualInactiveTabs public method
This allows querying from all throughout the app which of the current tabs are
inactive while taking into consideration whether the feature is enabled or not
such that when the feature is disabled it will always return an empty result.
3 years ago
Gabriel Luong da395d1038 For #21776 - Local 'var' is never modified and can be declared as 'val' 3 years ago
Mugurell acdde511d3 For #22070 - Prevent crash for when a selected topic does not exist anymore
The list of selected topics overwrites old data whenever user selects or
deselects another so the old selections will not leak for long.
3 years ago
Gabriel Luong 07a6a386f8 For #21753 - Refactor Pocket out of sessioncontrol 3 years ago
Jonathan Almeida 8c2cbb4e41 Issue #21642: Remove in-progress media tab from homescreen 3 years ago
Mugurell 565beb88c9 For #21593 - Refactor out "isSelected" from PocketRecommendedStoriesCategory
Having the list of categories and the list of selected categories separate in
State allows updating them independently.
3 years ago
Roger Yang 1092383231 No issue: Make sure jump back in group always have more than one tab 3 years ago
Mugurell 53d4336939 For #21592 - Don't topup with general stories 3 years ago
Mugurell 0c632dbbdb For #21391 - Final design composables
Fonts are not exactly following the Figma design but do better suit the overall
design since the other fonts are also not respecting the latest specs.
3 years ago
Mugurell c1f0e5a611 For #21275 - Sort items by how many times they were actually shown 3 years ago
Roger Yang 8a15e8a681 Close #21451: Add active search term tab groups on home 3 years ago
Mugurell ba4c44afcf For #21045: Add categories support 3 years ago
Noah Bond 28b07e7c8b
Issue mozilla-mobile#21140 - Updated recent tab logic to show media tab and second-to-last tab, if the media tab was the last active tab. (#21141)
* Issue mozilla-mobile#21140 - Updated recent tab logic to show media tab and second-to-last tab, if the media tab was the last active tab.

* Fixed RecentTabsListFeatureTest unit test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
3 years ago
Michael Comella cc380695b8 No issue: remove unnecessary robolectric annotations.
Theoretically, this should marginally decrease the duration of our unit
test suite. In my testing, for 1 iteration each (i.e. noise is very
possible), the duration changed from 9m 32s to 8m 21s – a 71s
improvement.

---

To identify tests that were running with robolectric that didn't need to
be, I removed the @RunWith(FenixRobo... from all relevant files:
    sed -i '' "/@RunWith(FenixRobolectric/d" app/src/test/**/*.kt

I ran the tests and discovered which ones failed from the Classes tab of
the index.html test result file. Something like:
    tests = document.querySelectorAll('table')[3].querySelectorAll('tr');
    failureElements = tests.querySelectorAll('.failures');
    // TODO: extract the test names

Then I copied these results to a text file and compared them to all the
files that had robolectric test runners to figure out which ones still
pass:
    comm -1 -2 failures.txt changed_files.txt > robolectric_not_needed.txt

And undid the changes to the failing files:
    for i in $(cat robolectric_not_needed.txt); do git checkout $i; done

Then I removed the import statements on those files:
    for i in $(cut changed_files.txt); do sed -i '' "/import.*RunWith/d" $i; done
    for i in $(cat changed_files.txt); do sed -i '' "/import.*RobolectricTestRunner/d" $i; done
3 years ago
Sebastian Kaspari 971b419d77 Run ktlintFormat to adapt to latest formatting rules. 3 years ago
Sebastian Kaspari 7840aac3ba Update Robolectric and mockk. 3 years ago
Mugurell 2c8c6d29ea For #20402 - Re-enable "in progress media tab"
The crash for when media starts playing in a custom tab is now resolved in AC.
3 years ago
Christian Sadilek 589f166b29 Issue #16330: Remove remaining usages of Sentry.capture 3 years ago
Jonathan Almeida 41ba94b951 Issue #20402: Disable LastMediaAccessMiddleware temporarily
The reducer in this middleware assumes the SessionState is always a
TabSessionState which holds the lastMediaAccess. This is true for the
lastAccess long which is a persistent state.

The list of MediaSessionActions however can also come from Custom Tabs
which relies on a CustomTabSessionState.

For now, the temporary fix is to disable this feature by removing the
middleware and no longer adding the last accessed media to the
recent tabs list ("Jump back in") to avoid crashing users while we think
of a real fix.
3 years ago
Mugurell 1251894933 For #19933 - Show a media tab item on homescreen for the last tab with media 3 years ago
Roger Yang 74c1cc82fb Closes #19921: Update appcompat and fragment dependencies to 1.3.x 3 years ago
Gabriel Luong 9d3cf79051 For #19916 - Add last viewed tab to home screen
Co-authored-by: Jonathan Almeida <jalmeida@mozilla.com>
3 years ago
Sebastian Kaspari 4753a1d494 Complete browser-state migration and remove browser-session dependency.
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
3 years ago
Arturo Mejia c725493bea Fix openFile breaking changes 3 years ago
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
Arturo Mejia 0e8dc6164d Target Android 11 3 years ago
Sebastian Kaspari f4f5e4b663 Issue #17174: Remove usage of old media APIs. 3 years ago
Grisha Kruglov ebca575e26 Reuse helper functions in bookmark tests 3 years ago
MarcLeclair 7b1af41b40
15278 detekt rule runblocking (#15942)
* For #15278: added CoroutineManager to count runBlocking calls

* For #15278: Added actual detekt rule for runblocking and its config to the yaml

* For #15278: Added unit test for RunblockingCounter

* For #15278: renamed StrictModeStartupSuppressionCountTest.kt to PerformanceStartupTest.kt and added runBlockingCount test

* Lint fix

* For #15278: made runblocking a Long to prevent overflow

* For #15278: fixed MozRunblocking name, description and moved RunBlockingCounter to perf package

* For #15278:Renamed MozillaRunblockingCheck to MozillaRunBlockingCheck

* For #15278: Added setup for unit test, since it failed without restting counter

* For #15278: Fixed naming for RunBlocking lint check

* For #15278: removed changes made to test to use runBlockingIncrement

* For #15728: added test exclusion for runBlocking check

* For #15278: changed null check and added Synchronized to count setter

* For #15278: fix for nits

* For #15278: added StartupExcessiveResourceUseTest to CODEOWNERS

* For #15278: fixed for nits

* For #15278: Moved increment function to extension function and fixed indentation

* For #15278: Added tests for Atomic Integer extension and nit fix
4 years ago
Michael Comella 42cca072e2 For #13959: remove resetAfter & port tests to StrictModeManager. 4 years ago
Kate Glazko e8855c09e6 For #15320: Ensure Mimetype Other PDF Shows PDF Icon 4 years ago
Tiger Oakes b563576335
Closes #14131: Move constants to dimens.xml (#14135)
Co-authored-by: Elise Richards <erichards@mozilla.com>
4 years ago
ekager 09fbb43f80 For #2486 - Adds Recently Closed Tabs 4 years ago
Kate Glazko ffb794751e No Issue: Fix DownloadItemKtTest 4 years ago
kglazko 5ecab0f48a
For #13935: Enhanced File Type List Icons (#14036)
* For #13935: Enhanced File Type List Icons

* For #13935 - Pulls out and tests logic for getting the icon for a DownloadItem

Co-authored-by: Kate Glazko <kglazko@Kates-MacBook-Pro.local>
Co-authored-by: Jeff Boek <jeff@jeffboek.com>
4 years ago
Kate Glazko 3370762248 For #13983: Show Only Completed Downloads in List 4 years ago
Kate Glazko 7f9e2255f7 For #13979: Deleted Download Files Shouldnt Show 4 years ago