Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
[video_player][camera] Use TestWidgetsFlutterBinding.ensureInitialize…
Browse files Browse the repository at this point in the history
…d(); to make sure necessary resources are initialized. (#3892)
  • Loading branch information
Chris Yang authored May 14, 2021
1 parent 95a0a5c commit d0a9aea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/camera/camera/test/camera_image_stream_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

import 'package:camera/camera.dart';
import 'package:camera_platform_interface/camera_platform_interface.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';

import 'camera_test.dart';
import 'utils/method_channel_mock.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
TestWidgetsFlutterBinding.ensureInitialized();

setUp(() {
CameraPlatform.instance = MockCameraPlatform();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:video_player/video_player.dart';

Expand All @@ -12,7 +11,7 @@ void main() {
// This test needs to run first and therefore needs to be the only test
// in this file.
test('plugin initialized', () async {
WidgetsFlutterBinding.ensureInitialized();
TestWidgetsFlutterBinding.ensureInitialized();
FakeVideoPlayerPlatform fakeVideoPlayerPlatform = FakeVideoPlayerPlatform();

final VideoPlayerController controller = VideoPlayerController.network(
Expand Down

0 comments on commit d0a9aea

Please sign in to comment.