Skip to content

Commit

Permalink
Add Dart unit tests for create method on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
FirentisTFW committed Dec 18, 2024
1 parent f41ff9a commit 7e297f3
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,31 @@ void main() {
<String, String>{'Authorization': 'Bearer token'});
expect(textureId, 3);
});

test('create with texture view', () async {
final int? textureId = await player.create(DataSource(
sourceType: DataSourceType.file,
uri: 'someUri',
// Texture view is a default view type.
));
expect(log.log.last, 'create');
expect(
log.passedCreateMessage?.viewType, PlatformVideoViewType.textureView);
expect(textureId, 3);
});

test('create with platform view', () async {
final int? playerId = await player.create(DataSource(
sourceType: DataSourceType.file,
uri: 'someUri',
viewType: VideoViewType.platformView,
));
expect(log.log.last, 'create');
expect(log.passedCreateMessage?.viewType,
PlatformVideoViewType.platformView);
expect(playerId, 3);
});

test('setLooping', () async {
await player.setLooping(1, true);
expect(log.log.last, 'setLooping');
Expand Down

0 comments on commit 7e297f3

Please sign in to comment.