Commit Graph

35 Commits (1f633edd7d4436f20ead4ba657b1284b94cca0c6)

Author SHA1 Message Date
Gabriel Luong a6c8f8b313 For #24252 - Rename destructive attribute to textWarning 2 years ago
Alexandru2909 19d1e227ed For #23936 - Show dialog on credit card delete 2 years ago
Gabriel Luong f47a428f44
For #23771 - Set correct destructive text color for card editor error messages (#23803)
Co-authored-by: tristan-jea <>
Co-authored-by: Tristan <99796140+tristan-jea@users.noreply.github.com>
2 years ago
Alexandru2909 a34711c444 For #20524 - Remove redundant coroutine dispatchers from tests 2 years ago
Grisha Kruglov 33af7d8729 Fix breaking change in KeyProvider
`key` was renamed to `getOrGenerateKey` and is now a `suspend`.
3 years ago
Grisha Kruglov 8de4c0b4db For #22569: Remove allopen plugin and Mockable annotations 3 years ago
Sebastian Kaspari 170fa9705e Update Kotlin and Jetpack Compose versions. 3 years ago
Roger Yang 5d22bb4707 Issue #18711: Telemetry for credit card autofill 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
Roger Yang 2ac5a38120 Revert "For #18711: Telemetry for credit card autofill (#19548)"
This reverts commit e0b410efdf.
3 years ago
Roger Yang 2ed4115a6c Revert "For #18711 - Refactor credit card telemetry under the Metrics ping (#19733)"
This reverts commit 172a118a51.
3 years ago
Sebastian Kaspari 971b419d77 Run ktlintFormat to adapt to latest formatting rules. 3 years ago
mcarare cca7892e91 For #17917: Use View binding in settings screens. 3 years ago
Roger Yang 74c1cc82fb Closes #19921: Update appcompat and fragment dependencies to 1.3.x 3 years ago
Gabriel Luong 74a96905a3
For #19495 - Add validation for the name on card (#19836)
- We want to ensure that name on card in the credit card is not empty when submitted. Display an appropriate error when the field is invalid.
3 years ago
Gabriel Luong 172a118a51
For #18711 - Refactor credit card telemetry under the Metrics ping (#19733) 3 years ago
Elise Richards e0b410efdf
For #18711: Telemetry for credit card autofill (#19548) 3 years ago
Gabriel Luong 89a1b0016c
For #19492 - Provide the correct CreditCardNumber type to UpdatableCreditCardFields when updating a credit card (#19692)
We were crashing because we were specifying the wrong `CreditCardNumber` type when constructing the `UpdatableCreditCardFields`.
We only had the plaintext card number from the user input, but was placing it off as an encrypted card number, which resulted in the crash.
3 years ago
Elise Richards 279d59897c
For #18264 - Add biometric prompt to credit card settings (#19505) 3 years ago
Gabriel Luong 338c488fae
For #19680 - Show the card number when editing a credit card (#19681) 3 years ago
Gabriel Luong c11335fafc
For #18271 - [Saved cards] Display the credit card provider icon and report the correct card type (#19652) 3 years ago
Ionut Cristian Bedregeanu ac71b47c61 For #19653 - Address 19643 PR comments
Rename handleAddCreditCard to handleAddCreditCardClicked
Rename onClickAddCreditCard to onAddCreditCardClick
Format layout_add_credit_card.xml
3 years ago
Ionut Cristian Bedregeanu 0a226962bb For #18881 - Create a new layout for 'Add credit card' button
Add functionality for 'Add credit card' button

Add unit tests for 'Add credit card' functionality
3 years ago
Codrut Topliceanu 5f2b3fec38
For #18270 - Adds ellipses+last 4 digits to CC display (#19420)
* For #18270 - Adds ellipses+last 4 digits to CC display
3 years ago
mcarare bcf6b901ee For #19600: Change manage cards preference UI dynamically. 3 years ago
mcarare 516d52997d For #18266: Validate credit card entry info. 3 years ago
Grisha Kruglov 4e16c46b27 Fix breaking changes introduced by credit card encryption APIs 3 years ago
Mihai Adrian Carare e952513569
For #19065 - Add extension functions to be used with credit cards. (#19187) 3 years ago
mcarare 00744fa9e5 For #18267: Updates preferences visibility depending on creditCardsStore 3 years ago
Gabriel Luong 2e562579ed
For #18274 - [Edit card] Update a saved credit card information (#19032) 3 years ago
Gabriel Luong f7c56ee6fa
For #18273 - [Edit card] Delete a saved credit card (#19029) 3 years ago
Gabriel Luong 6eb528f912
For #18272 - [Edit card] Display a saved card information in the Edit card screen (#18884) 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
Gabriel Luong 37b6079d83
For #18268, #18269 - [Saved cards] Display a list of Saved cards fetched from the credit card storage (#18808) 3 years ago
Gabriel Luong 1008ca2b4a
For #18265 - [Add card] Integrate the credit card storage and handle adding a new credit card (#18719) 3 years ago