File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
packages/camera/camera_web/example/integration_test Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -713,10 +713,10 @@ void main() {
713713 'when the facing mode setting is empty and '
714714 'the facingMode capability is null' , (WidgetTester tester) async {
715715 mockVideoTrack.getSettings = () {
716- return web.MediaTrackSettings (facingMode: '' );
716+ return createJSInteropWrapper (FakeMediaTrackSettings ())
717+ as web.MediaTrackSettings ;
717718 }.toJS;
718719 mockVideoTrack.getCapabilities = () {
719- // Use the fake class that has no facingMode property
720720 return createJSInteropWrapper (FakeMediaTrackCapabilities ())
721721 as web.MediaTrackCapabilities ;
722722 }.toJS;
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import 'dart:ui';
1111// ignore_for_file: implementation_imports
1212import 'package:camera_web/src/camera.dart' ;
1313import 'package:camera_web/src/camera_service.dart' ;
14- import 'package:camera_web/src/pkg_web_tweaks.dart' ;
1514import 'package:camera_web/src/shims/dart_js_util.dart' ;
1615import 'package:camera_web/src/types/types.dart' ;
1716import 'package:mockito/annotations.dart' ;
@@ -292,7 +291,16 @@ class MockEventStreamProvider<T extends web.Event> extends Mock
292291/// the facingMode capability.
293292@JSExport ()
294293class FakeMediaTrackCapabilities {
294+ // Dummy property required by @JSExport
295+ bool get dummy => true ;
296+ }
295297
298+ /// A fake [web.MediaTrackSettings] where facingMode is null/undefined.
299+ ///
300+ /// Used to test null-safe handling when the browser doesn't provide
301+ /// the facingMode capability.
302+ @JSExport ()
303+ class FakeMediaTrackSettings {
296304 // Dummy property required by @JSExport
297305 bool get dummy => true ;
298306}
You can’t perform that action at this time.
0 commit comments