Skip to content

[tizen_app_control] Update integration tests#1068

Open
seungsoo47 wants to merge 1 commit into
flutter-tizen:masterfrom
seungsoo47:tizen_app_control-update-integration-tests
Open

[tizen_app_control] Update integration tests#1068
seungsoo47 wants to merge 1 commit into
flutter-tizen:masterfrom
seungsoo47:tizen_app_control-update-integration-tests

Conversation

@seungsoo47

Copy link
Copy Markdown
Contributor
  • Relax the 'Can find matching applications' assertion from isNotEmpty to greaterThanOrEqualTo(0): app_control_foreach_app_matched returns APP_CONTROL_ERROR_NONE with an empty list when no apps match, so an empty result is not an error.
  • Add 'Can send and receive request with uri and mime': verifies that uri and mime fields are correctly transmitted and received (the existing test only covered the null case).
  • Strengthen the String list extra data assertion in 'Omit invalid extra data' to check exact values instead of just isNotEmpty.

Validated on RPI4 and TV emulator (T-samsung-10.0-x86_64): 7 tests, all pass.

- Relax the 'Can find matching applications' assertion from isNotEmpty to
  greaterThanOrEqualTo(0): app_control_foreach_app_matched returns
  APP_CONTROL_ERROR_NONE with an empty list when no apps match, so an
  empty result is not an error.
- Add 'Can send and receive request with uri and mime': verifies that uri
  and mime fields are correctly transmitted and received (the existing
  test only covered the null case).
- Strengthen the String list extra data assertion in 'Omit invalid extra
  data' to check exact values instead of just isNotEmpty.

Validated on RPI4 and TV emulator (T-samsung-10.0-x86_64): 7 tests, all pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@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 updates the integration tests for tizen_app_control by relaxing the matched app IDs assertion, adding a test for URI and MIME round-trips, and verifying exact string list extra data. Feedback highlights a tautological assertion on list length that should be replaced with a type check, and a potential race condition in the new test where the broadcast stream should be listened to before triggering the launch request.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

);
final List<String> matches = await request.getMatchedAppIds();
expect(matches, isNotEmpty);
expect(matches.length, greaterThanOrEqualTo(0));

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.

medium

Asserting matches.length is greaterThanOrEqualTo(0) is a tautology because a list's length is always non-negative. This assertion will always pass and does not verify anything useful.

If the goal is to verify that the method returns a valid list of strings (even if empty), you can explicitly assert its type using isA<List<String>>().

Suggested change
expect(matches.length, greaterThanOrEqualTo(0));
expect(matches, isA<List<String>>());

Comment on lines +63 to +65
await request.sendLaunchRequest();

final ReceivedAppControl received = await AppControl.onAppControl.first;

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.

medium

There is a potential race condition here. Since AppControl.onAppControl is a broadcast stream, any events emitted after sendLaunchRequest() completes but before AppControl.onAppControl.first is subscribed to will be lost.

To prevent flakiness, you should start listening to the stream (by creating the Future) before calling sendLaunchRequest().

Suggested change
await request.sendLaunchRequest();
final ReceivedAppControl received = await AppControl.onAppControl.first;
final Future<ReceivedAppControl> receivedFuture = AppControl.onAppControl.first;
await request.sendLaunchRequest();
final ReceivedAppControl received = await receivedFuture;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant