@@ -9,6 +9,7 @@ import 'package:flutter/foundation.dart';
99import 'package:flutter/material.dart' ;
1010import 'package:flutter/services.dart' show rootBundle;
1111import 'package:flutter_test/flutter_test.dart' ;
12+ import 'package:flutter_tizen/flutter_tizen.dart' ;
1213import 'package:integration_test/integration_test.dart' ;
1314import 'package:path_provider/path_provider.dart' ;
1415import 'package:video_player/video_player.dart' ;
@@ -318,65 +319,70 @@ void main() {
318319
319320 // Audio playback is tested to prevent accidental regression,
320321 // but could be removed in the future.
321- group ('asset audios' , () {
322- setUp (() {
323- controller = VideoPlayerController .asset ('assets/Audio.mp3' );
324- });
325-
326- testWidgets ('can be initialized' , (WidgetTester tester) async {
327- await controller.initialize ();
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 ();
328331
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- });
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+ });
340343
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 );
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 );
346349
347- await controller.play ();
348- await tester.pumpAndSettle (_playDuration);
350+ await controller.play ();
351+ await tester.pumpAndSettle (_playDuration);
349352
350- expect (controller.value.isPlaying, true );
351- expect (
352- controller.value.position,
353- (Duration position) => position > Duration .zero,
354- );
355- });
353+ expect (controller.value.isPlaying, true );
354+ expect (
355+ controller.value.position,
356+ (Duration position) => position > Duration .zero,
357+ );
358+ });
356359
357- testWidgets ('can seek' , (WidgetTester tester) async {
358- await controller.initialize ();
359- await controller.seekTo (const Duration (seconds: 3 ));
360+ testWidgets ('can seek' , (WidgetTester tester) async {
361+ await controller.initialize ();
362+ await controller.seekTo (const Duration (seconds: 3 ));
360363
361- expect (controller.value.position, const Duration (seconds: 3 ));
362- });
364+ expect (controller.value.position, const Duration (seconds: 3 ));
365+ });
363366
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 );
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 );
369372
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);
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);
376379
377- // Verify that we stopped playing after the pause.
378- expect (controller.value.isPlaying, false );
379- expect (controller.value.position, pausedPosition);
380- });
381- });
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+ );
382388}
0 commit comments