Skip to content

[url_launcher] Convert unit tests to Kotlin - #13018

Merged
auto-submit[bot] merged 14 commits into
flutter:mainfrom
stuartmorgan-g:url-launcher-kotlin-tests
Sep 29, 2026
Merged

auto-submit[bot] merged 14 commits into
flutter:mainfrom
stuartmorgan-g:url-launcher-kotlin-tests

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Converts url_launcher_android native unit tests from Java to Kotlin.

Similar to my other conversions, the process was:

  • Use the Android Studio deterministic auto-conversion.
  • Do a bunch of manual cleanup, as separate commits by topic.
    • This included adopting mockito-kotlin to make the mocking much less verbose and complex
  • Do a local Gemini review for where the code could be improved as Kotlin code, and address most of that feedback.

Does not include any changes to production code.

Part of flutter/flutter#188630

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@stuartmorgan-g stuartmorgan-g added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Sep 25, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 25, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request converts the Android unit tests for url_launcher (UrlLauncherTest and WebViewActivityTest) from Java to Kotlin, and adds the mockito-kotlin dependency to the build configuration. The review feedback suggests enhancing Kotlin safety and idiomatic practices by replacing direct calls and non-null assertions (!!) with safe navigation operators (?.) when verifying potentially null intent data and extras.

@gmackall gmackall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 29, 2026
@auto-submit
auto-submit Bot merged commit 5ef4d9e into flutter:main Sep 29, 2026
13 checks passed
Istiak-Ahmed78 pushed a commit to Istiak-Ahmed78/flutter that referenced this pull request Sep 30, 2026
…er#193578)

flutter/packages@3c6ce59...0ba9a82

2026-09-30 [email protected] [image_picker_ios] PR 1/5 Add
injectable protocol seams and migrate leaf native tests to Swift Testing
(flutter/packages#12897)
2026-09-30 [email protected] [material_ui]
Migrate M3 Dialog template to use new gen_defaults
(flutter/packages#12917)
2026-09-30 [email protected] [material_ui]
Migrate M3 FAB template to use new gen_defaults (flutter/packages#12921)
2026-09-30 [email protected] [material_ui]
Migrate M3 DatePicker template to use new gen_defaults
(flutter/packages#12914)
2026-09-29 [email protected] [material_ui] Document that
TextField.decoration is merged with InputDecorationTheme
(flutter/packages#12493)
2026-09-29 [email protected] [camera_android_camerax] Move
misplaced Javadoc above annotations (flutter/packages#13040)
2026-09-29 [email protected] [vector_graphics] Remove
unnecessary Material imports (flutter/packages#12798)
2026-09-29 [email protected] Roll Flutter from
c5a061b to 55b8f88 (8 revisions) (flutter/packages#13066)
2026-09-29 [email protected] [webview_flutter_wkwebview]
Regenerate with pigeon 29.0.4 (flutter/packages#12923)
2026-09-29 [email protected] [url_launcher] Convert unit tests to
Kotlin (flutter/packages#13018)
2026-09-29 [email protected] [material_ui, cupertino_ui] Fix unresolved
doc comment references (flutter/packages#13044)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: url_launcher platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants