Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #2165 - Implement pull-to-refresh gesture to sync history. #11386

Merged
merged 1 commit into from
Jun 11, 2020

Conversation

person808
Copy link
Contributor

Note: This is only 1/2 gestures described in #2165

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not

  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
    output

  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2020

Codecov Report

Merging #11386 into master will increase coverage by 0.04%.
The diff coverage is 41.37%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #11386      +/-   ##
============================================
+ Coverage     20.81%   20.86%   +0.04%     
- Complexity      680      681       +1     
============================================
  Files           373      373              
  Lines         15013    15038      +25     
  Branches       2026     2031       +5     
============================================
+ Hits           3125     3137      +12     
- Misses        11606    11617      +11     
- Partials        282      284       +2     
Impacted Files Coverage Δ Complexity Δ
...va/org/mozilla/fenix/components/metrics/Metrics.kt 20.65% <ø> (ø) 0.00 <0.00> (ø)
...boarding/OnboardingTrackingProtectionViewHolder.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...g/mozilla/fenix/library/history/HistoryFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/org/mozilla/fenix/library/history/HistoryView.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...zilla/fenix/settings/TrackingProtectionFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...mozilla/fenix/library/history/HistoryController.kt 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...illa/fenix/library/history/HistoryFragmentStore.kt 77.41% <100.00%> (+8.18%) 1.00 <0.00> (ø)
...mozilla/fenix/library/history/HistoryInteractor.kt 100.00% <100.00%> (ø) 13.00 <1.00> (+1.00)
.../fenix/browser/browsingmode/BrowsingModeManager.kt 85.71% <0.00%> (-14.29%) 0.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f163861...3283a03. Read the comment docs.

@BranescuMihai BranescuMihai requested a review from Mugurell June 10, 2020 15:56
@person808 person808 force-pushed the feature-history-2165 branch from 0bc3012 to 8587153 Compare June 10, 2020 21:01
Copy link
Contributor

@Mugurell Mugurell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Definitely a welcomed feature, thanks!
Waiting for Tiger's review also.

controller.handleRequestSync()

verify {
syncHistory.invoke(any())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also verify here that the right actions are emitted.
StartSync is easy to be verified, but verifying that syncHistory gets passed the FinishSync callback is a bit trickier.. maybe we could return that store.dispatch call from a method and then in the test verify if

  • store.dispatch(HistoryFragmentAction.StartSync) was called
  • store.dispatch(any()) was called 2 times
  • the method returning store.dispatch(HistoryFragmentAction.FinishSync) was called ?

@person808 person808 force-pushed the feature-history-2165 branch from 8587153 to 548e955 Compare June 11, 2020 15:59
@person808
Copy link
Contributor Author

@NotWoods Converted syncHistory to a suspend function and updated the test to verify actions are dispatched in the right order, but the test fails with this exception. Could you take a look and see what I'm missing to make the test run properly?

@NotWoods
Copy link
Contributor

You need to use a real coroutine scope instead of a mock, like this:

private val scope = TestCoroutineScope()

You'll also need to add an @ExperimentalCoroutinesApi annotation above the @RunWith annotation.

@person808 person808 force-pushed the feature-history-2165 branch from 548e955 to 3283a03 Compare June 11, 2020 17:03
@person808 person808 requested a review from NotWoods June 11, 2020 17:03
Copy link
Contributor

@NotWoods NotWoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@person808 person808 merged commit d14b39a into mozilla-mobile:master Jun 11, 2020
@person808 person808 deleted the feature-history-2165 branch June 11, 2020 17:23
@lime124 lime124 mentioned this pull request Jun 11, 2020
18 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants