Skip to content
Prev Previous commit
Next Next commit
Switch remaining tests from Pigeon generated tests to mockito
  • Loading branch information
stuartmorgan-g committed Jun 27, 2025
commit e3684d119cc4999ba4ec42c38b0d09ebd005aee2
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ VideoPlayerInstanceApi _productionApiProvider(int mapId) {
class AndroidVideoPlayer extends VideoPlayerPlatform {
/// Creates a new Android maps implementation instance.
AndroidVideoPlayer({
@visibleForTesting AndroidVideoPlayerApi? pluginApi,
@visibleForTesting
VideoPlayerInstanceApi Function(int playerId)? apiProvider,
}) : _apiProvider = apiProvider ?? _productionApiProvider;
}) : _api = pluginApi ?? AndroidVideoPlayerApi(),
_apiProvider = apiProvider ?? _productionApiProvider;

final AndroidVideoPlayerApi _api = AndroidVideoPlayerApi();
final AndroidVideoPlayerApi _api;
// A method to create VideoPlayerInstanceApi instances, which can be
//overridden for testing.
final VideoPlayerInstanceApi Function(int mapId) _apiProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/src/messages.g.dart',
dartTestOut: 'test/test_api.g.dart',
javaOut:
'android/src/main/java/io/flutter/plugins/videoplayer/Messages.java',
javaOptions: JavaOptions(package: 'io.flutter.plugins.videoplayer'),
Expand All @@ -34,7 +33,7 @@ class CreateMessage {
PlatformVideoViewType? viewType;
}

@HostApi(dartHostTestHandler: 'TestHostVideoPlayerApi')
@HostApi()
abstract class AndroidVideoPlayerApi {
void initialize();
int create(CreateMessage msg);
Expand Down
Loading