16
16
#import < video_player_avfoundation/FVPNativeVideoViewFactory.h>
17
17
#endif
18
18
19
- // TODO(stuartmorgan): Convert to using mock registrars instead.
20
- NSObject <FlutterPluginRegistry> *GetPluginRegistry (void ) {
21
- #if TARGET_OS_IOS
22
- return (NSObject <FlutterPluginRegistry> *)[[UIApplication sharedApplication ] delegate ];
23
- #else
24
- return (FlutterViewController *)NSApplication .sharedApplication .windows [0 ].contentViewController ;
25
- #endif
26
- }
27
-
28
19
#if TARGET_OS_IOS
29
20
@interface FakeAVAssetTrack : AVAssetTrack
30
21
@property (readonly , nonatomic ) CGAffineTransform preferredTransform;
@@ -168,18 +159,15 @@ - (FVPDisplayLink *)displayLinkWithRegistrar:(id<FlutterPluginRegistrar>)registr
168
159
@implementation VideoPlayerTests
169
160
170
161
- (void )testCreateWithOptionsReturnsErrorForInvalidAssetPath {
171
- NSObject <FlutterPluginRegistrar> *registrar = [ GetPluginRegistry ()
172
- registrarForPlugin: @" testCreateWithOptionsReturnsErrorForInvalidAssetPath " ] ;
162
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock ( @protocol (FlutterPluginRegistrar));
163
+ OCMStub ([registrar lookupKeyForAsset: [OCMArg any ]]). andReturn ( nil ) ;
173
164
FVPVideoPlayerPlugin *videoPlayerPlugin =
174
165
[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
175
166
176
167
FlutterError *initializationError;
177
168
[videoPlayerPlugin initialize: &initializationError];
178
169
XCTAssertNil (initializationError);
179
170
180
- id mockRegistrar = OCMPartialMock (registrar);
181
- OCMStub ([mockRegistrar lookupKeyForAsset: [OCMArg any ]]).andReturn (nil );
182
-
183
171
FVPCreationOptions *create =
184
172
[FVPCreationOptions makeWithAsset: @" invalid/path/to/asset"
185
173
uri: nil
@@ -202,8 +190,7 @@ - (void)testBlankVideoBugWithEncryptedVideoStreamAndInvertedAspectRatioBugForSom
202
190
// video streams (not just iOS 16). (https://github.com/flutter/flutter/issues/109116). An
203
191
// invisible AVPlayerLayer is used to overwrite the protection of pixel buffers in those streams
204
192
// for issue #1, and restore the correct width and height for issue #2.
205
- NSObject <FlutterPluginRegistrar> *registrar =
206
- [GetPluginRegistry () registrarForPlugin: @" testPlayerLayerWorkaround" ];
193
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
207
194
FVPVideoPlayerPlugin *videoPlayerPlugin =
208
195
[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
209
196
@@ -232,10 +219,8 @@ - (void)testBlankVideoBugWithEncryptedVideoStreamAndInvertedAspectRatioBugForSom
232
219
- (void )testPlayerForPlatformViewDoesNotRegisterTexture {
233
220
NSObject <FlutterTextureRegistry> *mockTextureRegistry =
234
221
OCMProtocolMock (@protocol (FlutterTextureRegistry));
235
- NSObject <FlutterPluginRegistrar> *registrar =
236
- [GetPluginRegistry () registrarForPlugin: @" testPlayerForPlatformViewDoesNotRegisterTexture" ];
237
- NSObject <FlutterPluginRegistrar> *partialRegistrar = OCMPartialMock (registrar);
238
- OCMStub ([partialRegistrar textures ]).andReturn (mockTextureRegistry);
222
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
223
+ OCMStub ([registrar textures ]).andReturn (mockTextureRegistry);
239
224
FVPDisplayLink *mockDisplayLink =
240
225
OCMPartialMock ([[FVPDisplayLink alloc ] initWithRegistrar: registrar
241
226
callback: ^(){
@@ -246,7 +231,7 @@ - (void)testPlayerForPlatformViewDoesNotRegisterTexture {
246
231
FVPVideoPlayerPlugin *videoPlayerPlugin = [[FVPVideoPlayerPlugin alloc ]
247
232
initWithAVFactory: [[StubFVPAVFactory alloc ] initWithPlayer: nil output: mockVideoOutput]
248
233
displayLinkFactory: stubDisplayLinkFactory
249
- registrar: partialRegistrar ];
234
+ registrar: registrar ];
250
235
251
236
FlutterError *initalizationError;
252
237
[videoPlayerPlugin initialize: &initalizationError];
@@ -267,10 +252,8 @@ - (void)testPlayerForPlatformViewDoesNotRegisterTexture {
267
252
- (void )testSeekToWhilePausedStartsDisplayLinkTemporarily {
268
253
NSObject <FlutterTextureRegistry> *mockTextureRegistry =
269
254
OCMProtocolMock (@protocol (FlutterTextureRegistry));
270
- NSObject <FlutterPluginRegistrar> *registrar =
271
- [GetPluginRegistry () registrarForPlugin: @" SeekToWhilePausedStartsDisplayLinkTemporarily" ];
272
- NSObject <FlutterPluginRegistrar> *partialRegistrar = OCMPartialMock (registrar);
273
- OCMStub ([partialRegistrar textures ]).andReturn (mockTextureRegistry);
255
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
256
+ OCMStub ([registrar textures ]).andReturn (mockTextureRegistry);
274
257
FVPDisplayLink *mockDisplayLink =
275
258
OCMPartialMock ([[FVPDisplayLink alloc ] initWithRegistrar: registrar
276
259
callback: ^(){
@@ -281,7 +264,7 @@ - (void)testSeekToWhilePausedStartsDisplayLinkTemporarily {
281
264
FVPVideoPlayerPlugin *videoPlayerPlugin = [[FVPVideoPlayerPlugin alloc ]
282
265
initWithAVFactory: [[StubFVPAVFactory alloc ] initWithPlayer: nil output: mockVideoOutput]
283
266
displayLinkFactory: stubDisplayLinkFactory
284
- registrar: partialRegistrar ];
267
+ registrar: registrar ];
285
268
286
269
FlutterError *initalizationError;
287
270
[videoPlayerPlugin initialize: &initalizationError];
@@ -338,10 +321,8 @@ - (void)testSeekToWhilePausedStartsDisplayLinkTemporarily {
338
321
- (void )testInitStartsDisplayLinkTemporarily {
339
322
NSObject <FlutterTextureRegistry> *mockTextureRegistry =
340
323
OCMProtocolMock (@protocol (FlutterTextureRegistry));
341
- NSObject <FlutterPluginRegistrar> *registrar =
342
- [GetPluginRegistry () registrarForPlugin: @" InitStartsDisplayLinkTemporarily" ];
343
- NSObject <FlutterPluginRegistrar> *partialRegistrar = OCMPartialMock (registrar);
344
- OCMStub ([partialRegistrar textures ]).andReturn (mockTextureRegistry);
324
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
325
+ OCMStub ([registrar textures ]).andReturn (mockTextureRegistry);
345
326
FVPDisplayLink *mockDisplayLink =
346
327
OCMPartialMock ([[FVPDisplayLink alloc ] initWithRegistrar: registrar
347
328
callback: ^(){
@@ -354,7 +335,7 @@ - (void)testInitStartsDisplayLinkTemporarily {
354
335
initWithAVFactory: [[StubFVPAVFactory alloc ] initWithPlayer: stubAVPlayer
355
336
output: mockVideoOutput]
356
337
displayLinkFactory: stubDisplayLinkFactory
357
- registrar: partialRegistrar ];
338
+ registrar: registrar ];
358
339
359
340
FlutterError *initalizationError;
360
341
[videoPlayerPlugin initialize: &initalizationError];
@@ -393,10 +374,8 @@ - (void)testInitStartsDisplayLinkTemporarily {
393
374
- (void )testSeekToWhilePlayingDoesNotStopDisplayLink {
394
375
NSObject <FlutterTextureRegistry> *mockTextureRegistry =
395
376
OCMProtocolMock (@protocol (FlutterTextureRegistry));
396
- NSObject <FlutterPluginRegistrar> *registrar =
397
- [GetPluginRegistry () registrarForPlugin: @" SeekToWhilePlayingDoesNotStopDisplayLink" ];
398
- NSObject <FlutterPluginRegistrar> *partialRegistrar = OCMPartialMock (registrar);
399
- OCMStub ([partialRegistrar textures ]).andReturn (mockTextureRegistry);
377
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
378
+ OCMStub ([registrar textures ]).andReturn (mockTextureRegistry);
400
379
FVPDisplayLink *mockDisplayLink =
401
380
OCMPartialMock ([[FVPDisplayLink alloc ] initWithRegistrar: registrar
402
381
callback: ^(){
@@ -407,7 +386,7 @@ - (void)testSeekToWhilePlayingDoesNotStopDisplayLink {
407
386
FVPVideoPlayerPlugin *videoPlayerPlugin = [[FVPVideoPlayerPlugin alloc ]
408
387
initWithAVFactory: [[StubFVPAVFactory alloc ] initWithPlayer: nil output: mockVideoOutput]
409
388
displayLinkFactory: stubDisplayLinkFactory
410
- registrar: partialRegistrar ];
389
+ registrar: registrar ];
411
390
412
391
FlutterError *initalizationError;
413
392
[videoPlayerPlugin initialize: &initalizationError];
@@ -463,10 +442,8 @@ - (void)testSeekToWhilePlayingDoesNotStopDisplayLink {
463
442
- (void )testPauseWhileWaitingForFrameDoesNotStopDisplayLink {
464
443
NSObject <FlutterTextureRegistry> *mockTextureRegistry =
465
444
OCMProtocolMock (@protocol (FlutterTextureRegistry));
466
- NSObject <FlutterPluginRegistrar> *registrar =
467
- [GetPluginRegistry () registrarForPlugin: @" PauseWhileWaitingForFrameDoesNotStopDisplayLink" ];
468
- NSObject <FlutterPluginRegistrar> *partialRegistrar = OCMPartialMock (registrar);
469
- OCMStub ([partialRegistrar textures ]).andReturn (mockTextureRegistry);
445
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
446
+ OCMStub ([registrar textures ]).andReturn (mockTextureRegistry);
470
447
FVPDisplayLink *mockDisplayLink =
471
448
OCMPartialMock ([[FVPDisplayLink alloc ] initWithRegistrar: registrar
472
449
callback: ^(){
@@ -477,7 +454,7 @@ - (void)testPauseWhileWaitingForFrameDoesNotStopDisplayLink {
477
454
FVPVideoPlayerPlugin *videoPlayerPlugin = [[FVPVideoPlayerPlugin alloc ]
478
455
initWithAVFactory: [[StubFVPAVFactory alloc ] initWithPlayer: nil output: mockVideoOutput]
479
456
displayLinkFactory: stubDisplayLinkFactory
480
- registrar: partialRegistrar ];
457
+ registrar: registrar ];
481
458
482
459
FlutterError *initalizationError;
483
460
[videoPlayerPlugin initialize: &initalizationError];
@@ -502,8 +479,7 @@ - (void)testPauseWhileWaitingForFrameDoesNotStopDisplayLink {
502
479
}
503
480
504
481
- (void )testDeregistersFromPlayer {
505
- NSObject <FlutterPluginRegistrar> *registrar =
506
- [GetPluginRegistry () registrarForPlugin: @" testDeregistersFromPlayer" ];
482
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
507
483
FVPVideoPlayerPlugin *videoPlayerPlugin =
508
484
(FVPVideoPlayerPlugin *)[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
509
485
@@ -535,8 +511,7 @@ - (void)testDeregistersFromPlayer {
535
511
}
536
512
537
513
- (void )testBufferingStateFromPlayer {
538
- NSObject <FlutterPluginRegistrar> *registrar =
539
- [GetPluginRegistry () registrarForPlugin: @" testLiveStreamBufferEndFromPlayer" ];
514
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
540
515
FVPVideoPlayerPlugin *videoPlayerPlugin =
541
516
(FVPVideoPlayerPlugin *)[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
542
517
@@ -580,8 +555,7 @@ - (void)testBufferingStateFromPlayer {
580
555
}
581
556
582
557
- (void )testVideoControls {
583
- NSObject <FlutterPluginRegistrar> *registrar =
584
- [GetPluginRegistry () registrarForPlugin: @" TestVideoControls" ];
558
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
585
559
586
560
FVPVideoPlayerPlugin *videoPlayerPlugin =
587
561
(FVPVideoPlayerPlugin *)[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
@@ -595,8 +569,7 @@ - (void)testVideoControls {
595
569
}
596
570
597
571
- (void )testAudioControls {
598
- NSObject <FlutterPluginRegistrar> *registrar =
599
- [GetPluginRegistry () registrarForPlugin: @" TestAudioControls" ];
572
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
600
573
601
574
FVPVideoPlayerPlugin *videoPlayerPlugin =
602
575
(FVPVideoPlayerPlugin *)[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
@@ -611,8 +584,7 @@ - (void)testAudioControls {
611
584
}
612
585
613
586
- (void )testHLSControls {
614
- NSObject <FlutterPluginRegistrar> *registrar =
615
- [GetPluginRegistry () registrarForPlugin: @" TestHLSControls" ];
587
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
616
588
617
589
FVPVideoPlayerPlugin *videoPlayerPlugin =
618
590
(FVPVideoPlayerPlugin *)[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
@@ -627,8 +599,7 @@ - (void)testHLSControls {
627
599
628
600
- (void )testAudioOnlyHLSControls {
629
601
XCTSkip (@" Flaky; see https://github.com/flutter/flutter/issues/164381" );
630
- NSObject <FlutterPluginRegistrar> *registrar =
631
- [GetPluginRegistry () registrarForPlugin: @" TestAudioOnlyHLSControls" ];
602
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
632
603
633
604
FVPVideoPlayerPlugin *videoPlayerPlugin =
634
605
(FVPVideoPlayerPlugin *)[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
@@ -656,8 +627,7 @@ - (void)testTransformFix {
656
627
#endif
657
628
658
629
- (void )testSeekToleranceWhenNotSeekingToEnd {
659
- NSObject <FlutterPluginRegistrar> *registrar =
660
- [GetPluginRegistry () registrarForPlugin: @" TestSeekTolerance" ];
630
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
661
631
662
632
StubAVPlayer *stubAVPlayer = [[StubAVPlayer alloc ] init ];
663
633
StubFVPAVFactory *stubAVFactory = [[StubFVPAVFactory alloc ] initWithPlayer: stubAVPlayer
@@ -695,8 +665,7 @@ - (void)testSeekToleranceWhenNotSeekingToEnd {
695
665
}
696
666
697
667
- (void )testSeekToleranceWhenSeekingToEnd {
698
- NSObject <FlutterPluginRegistrar> *registrar =
699
- [GetPluginRegistry () registrarForPlugin: @" TestSeekToEndTolerance" ];
668
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
700
669
701
670
StubAVPlayer *stubAVPlayer = [[StubAVPlayer alloc ] init ];
702
671
StubFVPAVFactory *stubAVFactory = [[StubFVPAVFactory alloc ] initWithPlayer: stubAVPlayer
@@ -792,8 +761,7 @@ - (void)testSeekToleranceWhenSeekingToEnd {
792
761
//
793
762
// Failing to de-register results in a crash in [AVPlayer willChangeValueForKey:].
794
763
- (void )testDoesNotCrashOnRateObservationAfterDisposal {
795
- NSObject <FlutterPluginRegistrar> *registrar =
796
- [GetPluginRegistry () registrarForPlugin: @" testDoesNotCrashOnRateObservationAfterDisposal" ];
764
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
797
765
798
766
AVPlayer *avPlayer = nil ;
799
767
__weak FVPVideoPlayer *weakPlayer = nil ;
@@ -848,8 +816,7 @@ - (void)testDoesNotCrashOnRateObservationAfterDisposal {
848
816
// Both of these methods dispatch [FVPVideoPlayer dispose] on the main thread
849
817
// leading to a possible crash when de-registering observers twice.
850
818
- (void )testHotReloadDoesNotCrash {
851
- NSObject <FlutterPluginRegistrar> *registrar =
852
- [GetPluginRegistry () registrarForPlugin: @" testHotReloadDoesNotCrash" ];
819
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
853
820
854
821
__weak FVPVideoPlayer *weakPlayer = nil ;
855
822
@@ -900,42 +867,32 @@ - (void)testHotReloadDoesNotCrash {
900
867
901
868
#if TARGET_OS_IOS
902
869
- (void )testNativeVideoViewFactoryRegistration {
903
- NSObject <FlutterPluginRegistry> *registry = GetPluginRegistry ();
904
- NSObject <FlutterPluginRegistrar> *registrar =
905
- [registry registrarForPlugin: @" testNativeVideoViewFactoryRegistration" ];
906
- id mockRegistrar = OCMPartialMock (registrar);
870
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
907
871
908
- OCMExpect ([mockRegistrar
909
- registerViewFactory: [OCMArg isKindOfClass: [FVPNativeVideoViewFactory class ]]
910
- withId: @" plugins.flutter.dev/video_player_ios" ]);
911
- [FVPVideoPlayerPlugin registerWithRegistrar: mockRegistrar];
872
+ OCMExpect ([registrar registerViewFactory: [OCMArg isKindOfClass: [FVPNativeVideoViewFactory class ]]
873
+ withId: @" plugins.flutter.dev/video_player_ios" ]);
874
+ [FVPVideoPlayerPlugin registerWithRegistrar: registrar];
912
875
913
- OCMVerifyAll (mockRegistrar );
876
+ OCMVerifyAll (registrar );
914
877
}
915
878
#endif
916
879
917
880
- (void )testPublishesInRegistration {
918
- NSString *pluginKey = @" TestRegistration" ;
919
- NSObject <FlutterPluginRegistry> *registry = GetPluginRegistry ();
920
- NSObject <FlutterPluginRegistrar> *registrar = [registry registrarForPlugin: pluginKey];
921
- id mockRegistrar = OCMPartialMock (registrar);
922
- // Empty stub to pass a check in Flutter's engine (double factory registration).
923
- // registerWithRegistrar gets called at the beginning of the test, and factory is registered
924
- // there. Additional call would try to register the same factory another time, which would fail a
925
- // check in the engine.
926
- OCMStub ([mockRegistrar registerViewFactory: [OCMArg any ] withId: [OCMArg any ]]);
927
-
928
- [FVPVideoPlayerPlugin registerWithRegistrar: mockRegistrar];
881
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
882
+ __block NSObject *publishedValue;
883
+ OCMStub ([registrar publish: [OCMArg checkWithBlock: ^BOOL (id value) {
884
+ publishedValue = value;
885
+ return YES ;
886
+ }]]);
929
887
930
- id publishedValue = [registry valuePublishedByPlugin: pluginKey ];
888
+ [FVPVideoPlayerPlugin registerWithRegistrar: registrar ];
931
889
932
890
XCTAssertNotNil (publishedValue);
933
891
XCTAssertTrue ([publishedValue isKindOfClass: [FVPVideoPlayerPlugin class ]]);
934
892
}
935
893
936
894
- (void )testFailedToLoadVideoEventShouldBeAlwaysSent {
937
- NSObject <FlutterPluginRegistrar> *registrar =
938
- [GetPluginRegistry () registrarForPlugin: @" testFailedToLoadVideoEventShouldBeAlwaysSent" ];
895
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
939
896
FVPVideoPlayerPlugin *videoPlayerPlugin =
940
897
[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
941
898
FlutterError *error;
@@ -969,8 +926,7 @@ - (void)testFailedToLoadVideoEventShouldBeAlwaysSent {
969
926
}
970
927
971
928
- (void )testUpdatePlayingStateShouldNotResetRate {
972
- NSObject <FlutterPluginRegistrar> *registrar =
973
- [GetPluginRegistry () registrarForPlugin: @" testUpdatePlayingStateShouldNotResetRate" ];
929
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
974
930
975
931
FVPVideoPlayerPlugin *videoPlayerPlugin = [[FVPVideoPlayerPlugin alloc ]
976
932
initWithAVFactory: [[StubFVPAVFactory alloc ] initWithPlayer: nil output: nil ]
@@ -1005,12 +961,10 @@ - (void)testUpdatePlayingStateShouldNotResetRate {
1005
961
}
1006
962
1007
963
- (void )testPlayerShouldNotDropEverySecondFrame {
1008
- NSObject <FlutterPluginRegistrar> *registrar =
1009
- [GetPluginRegistry () registrarForPlugin: @" testPlayerShouldNotDropEverySecondFrame" ];
1010
- NSObject <FlutterPluginRegistrar> *partialRegistrar = OCMPartialMock (registrar);
964
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
1011
965
NSObject <FlutterTextureRegistry> *mockTextureRegistry =
1012
966
OCMProtocolMock (@protocol (FlutterTextureRegistry));
1013
- OCMStub ([partialRegistrar textures ]).andReturn (mockTextureRegistry);
967
+ OCMStub ([registrar textures ]).andReturn (mockTextureRegistry);
1014
968
1015
969
FVPDisplayLink *displayLink = [[FVPDisplayLink alloc ] initWithRegistrar: registrar
1016
970
callback: ^(){
@@ -1021,7 +975,7 @@ - (void)testPlayerShouldNotDropEverySecondFrame {
1021
975
FVPVideoPlayerPlugin *videoPlayerPlugin = [[FVPVideoPlayerPlugin alloc ]
1022
976
initWithAVFactory: [[StubFVPAVFactory alloc ] initWithPlayer: nil output: mockVideoOutput]
1023
977
displayLinkFactory: stubDisplayLinkFactory
1024
- registrar: partialRegistrar ];
978
+ registrar: registrar ];
1025
979
1026
980
FlutterError *error;
1027
981
[videoPlayerPlugin initialize: &error];
@@ -1084,8 +1038,7 @@ - (void)testPlayerShouldNotDropEverySecondFrame {
1084
1038
1085
1039
#if TARGET_OS_IOS
1086
1040
- (void )testVideoPlayerShouldNotOverwritePlayAndRecordNorDefaultToSpeaker {
1087
- NSObject <FlutterPluginRegistrar> *registrar = [GetPluginRegistry ()
1088
- registrarForPlugin: @" testVideoPlayerShouldNotOverwritePlayAndRecordNorDefaultToSpeaker" ];
1041
+ NSObject <FlutterPluginRegistrar> *registrar = OCMProtocolMock (@protocol (FlutterPluginRegistrar));
1089
1042
FVPVideoPlayerPlugin *videoPlayerPlugin =
1090
1043
[[FVPVideoPlayerPlugin alloc ] initWithRegistrar: registrar];
1091
1044
FlutterError *error;
0 commit comments