mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-19 10:51:01 +03:00
fix(flutter): show the quality monitor's Transport row on the web only
The row was added for the web client, which has no session tab to name the transport on, but nothing gated it: a desktop session over WebRTC showed it too, duplicating the tab tooltip's "(WebRTC)". The getter now answers only on the web, as its own comment intended. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QcJZZeJ3Nqb2MHxXuUadkb
This commit is contained in:
28
flutter/test/quality_monitor_transport_test.dart
Normal file
28
flutter/test/quality_monitor_transport_test.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter_hbb/common.dart';
|
||||
import 'package:flutter_hbb/models/model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
final _sessionId = UuidValue('00000000-0000-0000-0000-000000000000');
|
||||
|
||||
class _FakeFFI implements FFI {
|
||||
@override
|
||||
UuidValue get sessionId => _sessionId;
|
||||
|
||||
@override
|
||||
late final FfiModel ffiModel = FfiModel(WeakReference(this));
|
||||
|
||||
@override
|
||||
dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
||||
}
|
||||
|
||||
void main() {
|
||||
test('the quality monitor names the WebRTC transport only on web', () {
|
||||
final ffi = _FakeFFI();
|
||||
ffi.ffiModel.cachedPeerData.streamType = 'WebRTC';
|
||||
final model = QualityMonitorModel(WeakReference(ffi));
|
||||
// Off the web the session tab's tooltip already names the transport.
|
||||
expect(isWeb, isFalse);
|
||||
expect(model.webrtcTransport, isNull);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user