Thanks to visit codestin.com
Credit goes to github.com

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

[camera]skip app delegate during unit test #4729

Merged

Conversation

hellohuanlin
Copy link
Contributor

@hellohuanlin hellohuanlin commented Feb 3, 2022

I noticed that during unit tests there are some code in app delegate that eventually setup the FLTCam in background thread, which runs concurrently with normal unit tests in main thread, making breakpoint a bit confusing when debugging.

This PR skips unnecessary didFinishLaunching setups for unit tests.

No version change: only affect Runner app's unit tests.

No unit tests: I don't think OCMock supports stubbing global functions. Just manually tested.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@hellohuanlin hellohuanlin force-pushed the camera_unit_test_app_delegate branch 3 times, most recently from 99dda0b to 5eac3c3 Compare February 4, 2022 00:22
@hellohuanlin hellohuanlin marked this pull request as ready for review February 4, 2022 00:25
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@hellohuanlin hellohuanlin requested review from jmagman, stuartmorgan-g and cyanglaz and removed request for bparrishMines February 4, 2022 00:25
@hellohuanlin hellohuanlin force-pushed the camera_unit_test_app_delegate branch 3 times, most recently from 7cec964 to 59b4142 Compare February 8, 2022 01:35
@hellohuanlin hellohuanlin force-pushed the camera_unit_test_app_delegate branch from 59b4142 to a06696d Compare February 8, 2022 01:35
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM

@Hixie
Copy link
Contributor

Hixie commented Feb 8, 2022

test-exempt: untestable (changes logic specifically for tests)

@hellohuanlin hellohuanlin added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Feb 8, 2022
@fluttergithubbot fluttergithubbot merged commit a931655 into flutter:main Feb 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs tests p: camera platform-ios waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants