Skip to content

[flutter_tts] Add integration tests for the supported TTS APIs#1041

Merged
seungsoo47 merged 4 commits into
flutter-tizen:masterfrom
seungsoo47:flutter_tts-add-integration-tests
Jun 30, 2026
Merged

[flutter_tts] Add integration tests for the supported TTS APIs#1041
seungsoo47 merged 4 commits into
flutter-tizen:masterfrom
seungsoo47:flutter_tts-add-integration-tests

Conversation

@seungsoo47

Copy link
Copy Markdown
Contributor

flutter_tts has no integration tests upstream, so add regression tests covering
the Tizen-supported parts of the flutter_tts v4.2.5 API (per the plugin's
"Supported APIs"):

  • speak / stop / pause return 1
  • getLanguages returns a non-empty list
  • isLanguageAvailable is true for a supported language
  • setLanguage returns 1 for a supported language
  • getVoices returns a non-empty list
  • getDefaultVoice returns a voice
  • setVoice returns 1
  • setSpeechRate returns 1
  • setVolume returns 1
  • getMaxSpeechInputLength is positive (calls stop() first so the engine is in
    the ready state that tts_get_max_text_size requires)

The isLanguageAvailable test is fixed to return a boolean value.

Validated on a Tizen TV (10.0) and Raspberry Pi 4: all tests pass
(12 passed, 0 skipped, 0 failed).

#1039

@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 Tizen implementation of the flutter_tts plugin to version 1.6.1. Key changes include modifying isLanguageAvailable to return a boolean instead of an integer, and adding a comprehensive suite of integration tests. The review feedback suggests optimizing the test suite by using setUpAll instead of setUp to avoid redundant 2-second initialization delays, and adding assertions to verify that lists of languages and voices are not empty before accessing their first elements to prevent uninformative StateError failures.

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.

Comment thread packages/flutter_tts/example/integration_test/flutter_tts_test.dart Outdated
Comment thread packages/flutter_tts/example/integration_test/flutter_tts_test.dart
Comment thread packages/flutter_tts/example/integration_test/flutter_tts_test.dart
Comment thread packages/flutter_tts/example/integration_test/flutter_tts_test.dart
Comment thread packages/flutter_tts/example/integration_test/flutter_tts_test.dart Outdated
Comment thread packages/flutter_tts/example/integration_test/flutter_tts_test.dart
Comment thread packages/flutter_tts/tizen/src/flutter_tts_tizen_plugin.cc
seungsoo47 and others added 4 commits June 22, 2026 12:02
isLanguageAvailable returned the integer 1/0 on Tizen, whereas other platforms
return a boolean. Return true/false instead so the result type matches the
flutter_tts API contract across platforms. Bump the version accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
flutter_tts has no integration tests upstream, so add regression tests covering
the Tizen-supported parts of the flutter_tts v4.2.5 API (per the plugin's
"Supported APIs"):

- speak / stop / pause return 1
- getLanguages returns a non-empty list
- isLanguageAvailable is true for a supported language
- setLanguage returns 1 for a supported language
- getVoices returns a non-empty list
- getDefaultVoice returns a voice
- setVoice returns 1
- setSpeechRate returns 1
- setVolume returns 1
- getMaxSpeechInputLength is positive (calls stop() first so the engine is in
  the ready state that tts_get_max_text_size requires)

The isLanguageAvailable test passes thanks to the boolean-return fix in the
previous commit.

Validated on a Tizen TV (10.0) and Raspberry Pi 4: all tests pass
(12 passed, 0 skipped, 0 failed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Use setUpAll instead of setUp to initialize the TTS engine once,
  reducing total test time by ~22 seconds (12 tests × 2s delay)
- Add tearDown to call stop() after each test to reset engine state
- Add explicit isNotEmpty assertions before accessing list elements
  in isLanguageAvailable, setLanguage, and setVoice tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove speak() call before stop() test: speak() returns as soon as
  tts_speak() is queued, so PLAYING state is not guaranteed when stop()
  is called; stop() is valid from any non-NONE state regardless
- Remove pause() test: tts_pause() only works from PLAYING state and
  there is no reliable way to wait for that transition in an integration test
- Bump version to 1.7.0: isLanguageAvailable return type changed from
  int to bool, which is an interface-level change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@seungsoo47 seungsoo47 force-pushed the flutter_tts-add-integration-tests branch from 20567d3 to 4f36aa8 Compare June 22, 2026 03:10
@seungsoo47 seungsoo47 merged commit 5548cb5 into flutter-tizen:master Jun 30, 2026
6 checks passed
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.

2 participants