Skip to content

Commit f7c53f9

Browse files
authored
Revert "[video_player] Temporarily comment out 'asset audio' test case (#889)" (#893)
1 parent 801c143 commit f7c53f9

File tree

2 files changed

+52
-59
lines changed

2 files changed

+52
-59
lines changed

packages/video_player/example/integration_test/video_player_test.dart

Lines changed: 52 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:flutter/foundation.dart';
99
import 'package:flutter/material.dart';
1010
import 'package:flutter/services.dart' show rootBundle;
1111
import 'package:flutter_test/flutter_test.dart';
12-
import 'package:flutter_tizen/flutter_tizen.dart';
1312
import 'package:integration_test/integration_test.dart';
1413
import 'package:path_provider/path_provider.dart';
1514
import 'package:video_player/video_player.dart';
@@ -319,70 +318,65 @@ void main() {
319318

320319
// Audio playback is tested to prevent accidental regression,
321320
// but could be removed in the future.
322-
group(
323-
'asset audios',
324-
() {
325-
setUp(() {
326-
controller = VideoPlayerController.asset('assets/Audio.mp3');
327-
});
328-
329-
testWidgets('can be initialized', (WidgetTester tester) async {
330-
await controller.initialize();
321+
group('asset audios', () {
322+
setUp(() {
323+
controller = VideoPlayerController.asset('assets/Audio.mp3');
324+
});
331325

332-
expect(controller.value.isInitialized, true);
333-
expect(controller.value.position, Duration.zero);
334-
expect(controller.value.isPlaying, false);
335-
// Due to the duration calculation accuracy between platforms,
336-
// the milliseconds on Web will be a slightly different from natives.
337-
// The audio was made with 44100 Hz, 192 Kbps CBR, and 32 bits.
338-
expect(
339-
controller.value.duration,
340-
const Duration(seconds: 5, milliseconds: kIsWeb ? 42 : 41),
341-
);
342-
});
326+
testWidgets('can be initialized', (WidgetTester tester) async {
327+
await controller.initialize();
343328

344-
testWidgets('can be played', (WidgetTester tester) async {
345-
await controller.initialize();
346-
// Mute to allow playing without DOM interaction on Web.
347-
// See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
348-
await controller.setVolume(0);
329+
expect(controller.value.isInitialized, true);
330+
expect(controller.value.position, Duration.zero);
331+
expect(controller.value.isPlaying, false);
332+
// Due to the duration calculation accuracy between platforms,
333+
// the milliseconds on Web will be a slightly different from natives.
334+
// The audio was made with 44100 Hz, 192 Kbps CBR, and 32 bits.
335+
expect(
336+
controller.value.duration,
337+
const Duration(seconds: 5, milliseconds: kIsWeb ? 42 : 41),
338+
);
339+
});
349340

350-
await controller.play();
351-
await tester.pumpAndSettle(_playDuration);
341+
testWidgets('can be played', (WidgetTester tester) async {
342+
await controller.initialize();
343+
// Mute to allow playing without DOM interaction on Web.
344+
// See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
345+
await controller.setVolume(0);
352346

353-
expect(controller.value.isPlaying, true);
354-
expect(
355-
controller.value.position,
356-
(Duration position) => position > Duration.zero,
357-
);
358-
});
347+
await controller.play();
348+
await tester.pumpAndSettle(_playDuration);
359349

360-
testWidgets('can seek', (WidgetTester tester) async {
361-
await controller.initialize();
362-
await controller.seekTo(const Duration(seconds: 3));
350+
expect(controller.value.isPlaying, true);
351+
expect(
352+
controller.value.position,
353+
(Duration position) => position > Duration.zero,
354+
);
355+
});
363356

364-
expect(controller.value.position, const Duration(seconds: 3));
365-
});
357+
testWidgets('can seek', (WidgetTester tester) async {
358+
await controller.initialize();
359+
await controller.seekTo(const Duration(seconds: 3));
366360

367-
testWidgets('can be paused', (WidgetTester tester) async {
368-
await controller.initialize();
369-
// Mute to allow playing without DOM interaction on Web.
370-
// See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
371-
await controller.setVolume(0);
361+
expect(controller.value.position, const Duration(seconds: 3));
362+
});
372363

373-
// Play for a second, then pause, and then wait a second.
374-
await controller.play();
375-
await tester.pumpAndSettle(_playDuration);
376-
await controller.pause();
377-
final Duration pausedPosition = controller.value.position;
378-
await tester.pumpAndSettle(_playDuration);
364+
testWidgets('can be paused', (WidgetTester tester) async {
365+
await controller.initialize();
366+
// Mute to allow playing without DOM interaction on Web.
367+
// See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
368+
await controller.setVolume(0);
379369

380-
// Verify that we stopped playing after the pause.
381-
expect(controller.value.isPlaying, false);
382-
expect(controller.value.position, pausedPosition);
383-
});
384-
},
385-
// NOTE(seungsoo47): Unknown errors sometimes occur in RPI.
386-
skip: isTizenProfile,
387-
);
370+
// Play for a second, then pause, and then wait a second.
371+
await controller.play();
372+
await tester.pumpAndSettle(_playDuration);
373+
await controller.pause();
374+
final Duration pausedPosition = controller.value.position;
375+
await tester.pumpAndSettle(_playDuration);
376+
377+
// Verify that we stopped playing after the pause.
378+
expect(controller.value.isPlaying, false);
379+
expect(controller.value.position, pausedPosition);
380+
});
381+
});
388382
}

packages/video_player/example/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dev_dependencies:
1818
sdk: flutter
1919
flutter_test:
2020
sdk: flutter
21-
flutter_tizen: ^0.2.5
2221
integration_test:
2322
sdk: flutter
2423
integration_test_tizen:

0 commit comments

Comments
 (0)