-
Notifications
You must be signed in to change notification settings - Fork 54
[tizen_app_control] Update integration tests #1068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,7 +30,7 @@ void main() { | |||||||||||||||
| mime: 'image/*', | ||||||||||||||||
| ); | ||||||||||||||||
| final List<String> matches = await request.getMatchedAppIds(); | ||||||||||||||||
| expect(matches, isNotEmpty); | ||||||||||||||||
| expect(matches.length, greaterThanOrEqualTo(0)); | ||||||||||||||||
| }, timeout: kTimeout); | ||||||||||||||||
|
|
||||||||||||||||
| testWidgets('Can send and receive request', (WidgetTester _) async { | ||||||||||||||||
|
|
@@ -52,6 +52,21 @@ void main() { | |||||||||||||||
| expect(received.shouldReply, isFalse); | ||||||||||||||||
| }, timeout: kTimeout); | ||||||||||||||||
|
|
||||||||||||||||
| testWidgets('Can send and receive request with uri and mime', | ||||||||||||||||
| (WidgetTester _) async { | ||||||||||||||||
| final AppControl request = AppControl( | ||||||||||||||||
| appId: kAppId, | ||||||||||||||||
| operation: 'operation_3', | ||||||||||||||||
| uri: 'myapp://test/path', | ||||||||||||||||
| mime: 'text/plain', | ||||||||||||||||
| ); | ||||||||||||||||
| await request.sendLaunchRequest(); | ||||||||||||||||
|
|
||||||||||||||||
| final ReceivedAppControl received = await AppControl.onAppControl.first; | ||||||||||||||||
|
Comment on lines
+63
to
+65
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a potential race condition here. Since To prevent flakiness, you should start listening to the stream (by creating the
Suggested change
|
||||||||||||||||
| expect(received.uri, 'myapp://test/path'); | ||||||||||||||||
| expect(received.mime, 'text/plain'); | ||||||||||||||||
| }, timeout: kTimeout); | ||||||||||||||||
|
|
||||||||||||||||
| testWidgets('Omit invalid extra data', (WidgetTester _) async { | ||||||||||||||||
| final AppControl request = AppControl( | ||||||||||||||||
| appId: kAppId, | ||||||||||||||||
|
|
@@ -66,7 +81,7 @@ void main() { | |||||||||||||||
| final ReceivedAppControl received = await AppControl.onAppControl.first; | ||||||||||||||||
| expect(received.extraData.length, 2); | ||||||||||||||||
| expect(received.extraData['STRING_DATA'], 'string'); | ||||||||||||||||
| expect(received.extraData['STRING_LIST_DATA'], isNotEmpty); | ||||||||||||||||
| expect(received.extraData['STRING_LIST_DATA'], <String>['string', 'list']); | ||||||||||||||||
| }, timeout: kTimeout); | ||||||||||||||||
|
|
||||||||||||||||
| testWidgets('Can send and receive reply', (WidgetTester _) async { | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asserting
matches.lengthisgreaterThanOrEqualTo(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>>().