Skip to content

[flutter_webrtc] Add regression integration tests and fix close() double-call error#1067

Open
seungsoo47 wants to merge 3 commits into
flutter-tizen:masterfrom
seungsoo47:flutter_webrtc-add-integration-tests
Open

[flutter_webrtc] Add regression integration tests and fix close() double-call error#1067
seungsoo47 wants to merge 3 commits into
flutter-tizen:masterfrom
seungsoo47:flutter_webrtc-add-integration-tests

Conversation

@seungsoo47

Copy link
Copy Markdown
Contributor
  • Fix RTCPeerConnection.close() throwing on Tizen when called more than once (the first call removed the connection from the internal map, so the second call couldn't find it). Now returns success instead of an error, per the WebRTC spec.
  • Add 8 Tizen regression integration tests covering RTCPeerConnection/RTCDataChannel (upstream flutter_webrtc has no integration tests at v1.5.2). Camera-dependent APIs like getUserMedia are excluded — no camera hardware on the test target.
  • All 8 cases pass, including the close()-idempotency case that depends on this fix

seungsoo47 and others added 2 commits July 15, 2026 21:16
Bump flutter_webrtc_tizen to 0.2.3.

Calling RTCPeerConnection.close() more than once caused an error on
Tizen. The first call removed the connection from the internal map,
so the second call could not find it and threw an exception.

Fixed by returning success instead of an error when the connection
is already closed. The WebRTC spec requires close() to be callable
multiple times without error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Upstream flutter_webrtc has no integration tests at v1.5.2, so
Tizen-specific regression tests were authored from the public API surface.

Added 8 test cases covering the API surface that works without camera
hardware (RTCPeerConnection and RTCDataChannel); camera-dependent APIs
such as getUserMedia are excluded because they require physical camera
hardware that is not available on the test target.

Tests added:
- RTCPeerConnection: creates with empty ice servers
- RTCPeerConnection: createOffer returns valid SDP
- RTCPeerConnection: setLocalDescription succeeds
- RTCPeerConnection: createAnswer returns valid SDP
- RTCPeerConnection: close is idempotent
- RTCDataChannel: createDataChannel returns channel with correct label
- RTCDataChannel: loopback text message exchange
- RTCDataChannel: loopback binary message exchange

The "close is idempotent" test required fixing the native plugin
(see preceding commit).

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 flutter_webrtc_tizen plugin to version 0.2.3, making RTCPeerConnection.close() idempotent by returning success instead of an error when the peer connection is already null. It also introduces integration tests for peer connections and data channels, along with the necessary test driver and dependency updates. The reviewer suggests improving the robustness of the loopback tests by checking the data channel state synchronously before registering listeners, rather than relying on timeouts with empty handlers.

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.

Register the onDataChannelState listener only after confirming the
channel isn't already open, per Gemini Code Assist review on PR flutter-tizen#1067.
The previous code could miss the open event if it fired before the
listener was attached, silently waiting out the full 10s timeout via
an empty onTimeout handler instead of failing when a channel never
opens.
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