Commit Graph

413 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
Oana Horvath 78f0086b7e For #17979 & #17840: fix and re-enable UI tests affected by main menu changes 3 years ago
Oana Horvath 358a3a3d4c Fix screenshots tests: showDefaultHomeScreen, bookmarksManagementTest 3 years ago
Arturo Mejia 8ca9f94abb For issue #16557 set autoplay block audio only
by default
3 years ago
Kate Glazko 841dacb69e For 17798: Sync Menu Item 3 years ago
Mugurell 0f0c319896 For #17772 - Collapse browser menu to "Add to Home screen"
The menu will start as collapsed.
Users can then swipe up to expand it.
3 years ago
Elise Richards ca33aef036
For #17770: New tab three-dot menu reorder (#18427)
* Create new menu order for new tab

* Add new tab menu navigation. Dynamically update menu when sync auth is needed. Make new tab menu and browser menu consistent.

* Lint

Lint and refactoring tests

* Tests for default toolbar menu

* Feature flag for request desktop site

Add todos for UI test issue 17979

Add todos for UI tests
3 years ago
AndiAJ e03ffff3b8 Disable failing UI Tests 3 years ago
Oana Horvath 246348501c For #18644: fix metod to verify system notifications 3 years ago
Oana Horvath aacb5e3ebb For #18421: Ignore the ContextMenusTest class because of test failures 3 years ago
Oana Horvath 1c0360af7b Disable customTrackingProtectionSettingsTest 3 years ago
Oana Horvath 11d410de0b Re-enable working UI tests from #18644 3 years ago
Mugurell 060b986f1c For #18644 - Temporarily disabling UI tests that fail on Firebase.
This is a quick solution to resume PR merges.
Investigations and a proper fix is to follow on this same ticket.
3 years ago
Arturo Mejia 869c99afaa For #15372 Optimize the order and messages of onboarding cards 3 years ago
Aaron Train 246c192de3
Closes #18623: Fix Gradle task name in gradlewbuild.py (#18624) 3 years ago
mcarare d0a45bab21 For #17799: Add extensions submenu item. 3 years ago
Oana Horvath 2743f9cf4f
For #18481: waits for url to be visible in TestHelper.verifyUrl() (#18498) 3 years ago
Oana Horvath be86061a11 Add first set of UI tests to Nightly 3 years ago
Oana Horvath a4691675a1 For #14005: fix strict TP tests loading timeout 3 years ago
dependabot[bot] 5259bdf7be Bump cryptography
Bumps [cryptography](https://github.com/pyca/cryptography) from 2.8 to 3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/2.8...3.2)

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Oana Horvath 9ac54fc06a For #18325: dismiss GooglePlay ToS dialog after UI test 3 years ago
Elise Richards 42cc4cb452
For #17802: Match the design for three-dot menu navigation (#17875)
* Feature flag for toolbar menu redesign. Add new items to menu and reorder.

* Handle toolbar items in menu controller

* Remove bookmark from toolbar nav

* Respect toolbar position

* Inline toolbar orientation checks

* Add Todos for bookmark UI tests

* Make variable names consistent
3 years ago
Jan-Erik Rediger 8b7279ebe4
Pass auto-generated build info (version code and name) to Glean (#18230)
This also re-generated the Glean docs due to an update of the bundled
glean-parser.
3 years ago
Oana Horvath 67c8345364 For #18040: no network access startup test 3 years ago
Vitaly V. Pinchuk 8f5244d528
Closes #18150: select tabs button not displayed (#18216)
For #18150: Improve showing/hiding of "Select tabs" button in tabs tray

Payload argument is unavailable after first call of notifyItemChanged() as the
whole View need to be updated.
Inject a "isPrivate" lambda in the adapter so it will always know what tabs are
currently showing and so always ensure the expected behavior.
3 years ago
AndiAJ 3d817204c2 For #18053 Change and fix Intermittent UI test verifyReaderViewToggle 3 years ago
Oana Horvath d7f1117e17 For #16317 UI tests: save longTap preference to restore it 3 years ago
Oana Horvath 4e4bbcc334 For #16317: resets long press delay at the end of UI tests 3 years ago
Jan-Erik Rediger 3e9ab1b150 Glean: Check for renamed reason 3 years ago
Mugurell 611ff8f25b For #17195 - Don't try setting an idle resource if the View is already off screen
Speculative fix based on the Firebase logs which shows that on a second check
of R.id.tab_wrapper it is not found the screen.
It may be because after `advanceToHalfExpandedState` and before getting a
reference to it in `waitForTabTrayBehaviorToIdle` it was already animated off
the screen.
With this in mind I've added a null check for the view reference before trying
to register an idling resource on it's Behavior.

Also added and used a way to click at a specific location in a View, not just
in the default middle in the View.
It was observed from the Firebase videos that a "click" on the topBar actually
selected the private tabs section. This would leave us to believe that the
"click" was caught by that other View which was placed above the x,y middle of
the topBar.
3 years ago
Mugurell 32493491fa For #17195 - Test a potential fix for the test 3 years ago
Oana Horvath 23cc3522aa For #17484, #18003 UI tests: retry closing tab if it fails 3 years ago
Elise Richards bab7693b9d
Remove unneeded temporary UI test ignores (#17980) 3 years ago
Elise Richards d0fd3e82c5
For #17771: three-dot menu reorder (#17838)
* Feature flag for toolbar menu redesign. Add new items to menu and reorder.

* Handle toolbar items in menu controller

* Menu controller tests

* Make icons invisible

* Lint

* UI tests reflect design change

* Refactor test names

* Lint fixes

* UI tests
3 years ago
ekager 08a1e0f728 For #17906 - Allow screenshots for private home screenshot test 3 years ago
Oana Horvath a98b40896d For #15259 UI test: waits for home screen to be visible 3 years ago
AndiAJ e31b4f49e9 For #17195 Fix Intermittent UI test verifyTabTrayNotShowingStateHalfExpanded 3 years ago
AndiAJ e0c70582b8 For #17852 Change and Fix Intermittent UI test openNewTabTest 3 years ago
AndiAJ 46888cc70f For #14523 Fix Intermittent tests verifyContextOpenLinkNewTab & verifyContextOpenLinkPrivateTab 3 years ago
Oana Horvath c6bf949a03 For #17847: Removes editCustomSearchEngineTest UI test 3 years ago
Oana Horvath f0b7b3b987 For #17847: disables editCustomSearchEngineTest 3 years ago
Andrei Joltan 936966596a
For #16020 Fix Intermittent tests caused by the Menu Button (#17829) 3 years ago
Oana Horvath 9783930ac5 For #16615: UI smoke test customTrackingProtectionSettingsTest 3 years ago
AndiAJ a4a2a59b7d For #12895 Fix Intermittent test navigateBookmarksFoldersTest 3 years ago
Oana Horvath f180d932c8 For #16959: verify page url not content in swipeToSwitchTabTest 3 years ago
AndiAJ c8c0131d00 Go Forward Test Fix 3 years ago
AndiAJ 5eb1a3d210 For #17641 Fix Intermittent test addPredefinedSearchEngineTest 3 years ago
AndiAJ 23e6f7aa91 For #16615: UI Smoke Tests for Tab Crash Reporter 3 years ago
Christian Sadilek 89ad370eb2 Remove SessionManager references from UI tests 3 years ago
Oana Horvath d7b8af78c9 For #9188: wait for page content to appear in Reader mode tests 3 years ago