tests and mocks for e2e testing (#78)
* tests and mocks for e2e testing * formatting * fix analyze errors
This commit is contained in:
@@ -36,5 +36,6 @@ class Native {
|
||||
} catch (error) {
|
||||
logger.warning('appleOSVersionString did throw error: ${error}');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import 'platform/io.dart' if (dart.library.html) 'platform/web.dart';
|
||||
|
||||
// Returns the current platform which works for both web and devices.
|
||||
PlatformType lkPlatform() => lkPlatformImplementation();
|
||||
|
||||
bool lkPlatformIs(PlatformType type) => lkPlatform() == type;
|
||||
|
||||
@internal
|
||||
bool lkPlatformIsTest() => Platform.environment.containsKey('FLUTTER_TEST');
|
||||
|
||||
enum PlatformType {
|
||||
web,
|
||||
windows,
|
||||
|
||||
@@ -23,6 +23,7 @@ class WebSocketEventHandlers {
|
||||
final WebSocketOnData? onData;
|
||||
final WebSocketOnError? onError;
|
||||
final WebSocketOnDispose? onDispose;
|
||||
|
||||
const WebSocketEventHandlers({
|
||||
this.onData,
|
||||
this.onError,
|
||||
@@ -30,12 +31,13 @@ class WebSocketEventHandlers {
|
||||
});
|
||||
}
|
||||
|
||||
typedef WebSocketConnector = Future<LiveKitWebSocket> Function(Uri uri,
|
||||
[WebSocketEventHandlers? options]);
|
||||
|
||||
abstract class LiveKitWebSocket extends Disposable {
|
||||
void send(List<int> data);
|
||||
|
||||
static Future<LiveKitWebSocket> connect(
|
||||
Uri uri, [
|
||||
WebSocketEventHandlers? options,
|
||||
]) =>
|
||||
static Future<LiveKitWebSocket> connect(Uri uri,
|
||||
[WebSocketEventHandlers? options]) =>
|
||||
lkWebSocketConnect(uri, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user