feat(voice): add iOS VAD runtime support
This commit is contained in:
@@ -22,39 +22,50 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:chanora_flutter/src/rust/api.dart' as rust;
|
||||
import 'package:chanora_flutter/src/rust/frb_generated.dart';
|
||||
|
||||
const _runE2e = bool.fromEnvironment('CHANORA_RUN_E2E');
|
||||
const _skipReason =
|
||||
'Set --dart-define=CHANORA_RUN_E2E=true with a built native bridge to run '
|
||||
'network end-to-end acceptance.';
|
||||
|
||||
void main() {
|
||||
setUpAll(() async {
|
||||
if (!_runE2e) return;
|
||||
await RustLib.init();
|
||||
});
|
||||
|
||||
test('connect/snapshot/disconnect against cn.teamspeak.app', () async {
|
||||
// Defensive: in case a previous test left a connection open.
|
||||
try {
|
||||
test(
|
||||
'connect/snapshot/disconnect against cn.teamspeak.app',
|
||||
() async {
|
||||
// Defensive: in case a previous test left a connection open.
|
||||
try {
|
||||
await rust.disconnect();
|
||||
} catch (_) {}
|
||||
|
||||
final snap = await rust.connect(
|
||||
host: 'cn.teamspeak.app',
|
||||
nickname: 'ChanoraAlphaTest',
|
||||
password: '',
|
||||
);
|
||||
expect(snap.serverName, isNotEmpty);
|
||||
expect(snap.channels, isNotEmpty);
|
||||
// Welcome message is allowed to be empty on some servers; just
|
||||
// assert it's a String type (which it always is — this is more a
|
||||
// smoke than a real assertion).
|
||||
expect(snap.welcomeMessage, isA<String>());
|
||||
|
||||
// Re-fetch the snapshot; should still succeed.
|
||||
final snap2 = await rust.snapshot();
|
||||
expect(snap2.serverName, snap.serverName);
|
||||
|
||||
final connectedBefore = await rust.isConnected();
|
||||
expect(connectedBefore, isTrue);
|
||||
|
||||
await rust.disconnect();
|
||||
} catch (_) {}
|
||||
|
||||
final snap = await rust.connect(
|
||||
host: 'cn.teamspeak.app',
|
||||
nickname: 'ChanoraAlphaTest',
|
||||
password: '',
|
||||
);
|
||||
expect(snap.serverName, isNotEmpty);
|
||||
expect(snap.channels, isNotEmpty);
|
||||
// Welcome message is allowed to be empty on some servers; just
|
||||
// assert it's a String type (which it always is — this is more a
|
||||
// smoke than a real assertion).
|
||||
expect(snap.welcomeMessage, isA<String>());
|
||||
|
||||
// Re-fetch the snapshot; should still succeed.
|
||||
final snap2 = await rust.snapshot();
|
||||
expect(snap2.serverName, snap.serverName);
|
||||
|
||||
final connectedBefore = await rust.isConnected();
|
||||
expect(connectedBefore, isTrue);
|
||||
|
||||
await rust.disconnect();
|
||||
|
||||
final connectedAfter = await rust.isConnected();
|
||||
expect(connectedAfter, isFalse);
|
||||
}, timeout: const Timeout(Duration(seconds: 30)));
|
||||
final connectedAfter = await rust.isConnected();
|
||||
expect(connectedAfter, isFalse);
|
||||
},
|
||||
timeout: const Timeout(Duration(seconds: 30)),
|
||||
skip: _runE2e ? false : _skipReason,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user