|
21 | 21 |
|
22 | 22 | #pragma mark - Test Helper Classes
|
23 | 23 |
|
| 24 | +static const FlutterPointerEvent kDefaultFlutterPointerEvent = {}; |
| 25 | +static const FlutterKeyEvent kDefaultFlutterKeyEvent = {}; |
| 26 | + |
24 | 27 | // A wrap to convert FlutterKeyEvent to a ObjC class.
|
25 | 28 | @interface KeyEventWrapper : NSObject
|
26 | 29 | @property(nonatomic) FlutterKeyEvent* data;
|
@@ -339,7 +342,7 @@ - (bool)testKeyEventsAreSentToFramework:(id)engineMock {
|
339 | 342 | OCMStub( // NOLINT(google-objc-avoid-throwing-exception)
|
340 | 343 | [engineMock binaryMessenger])
|
341 | 344 | .andReturn(binaryMessengerMock);
|
342 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 345 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
343 | 346 | callback:nil
|
344 | 347 | userData:nil])
|
345 | 348 | .andCall([FlutterViewControllerTestObjC class],
|
@@ -375,7 +378,7 @@ - (bool)testKeyEventsAreSentToFramework:(id)engineMock {
|
375 | 378 | - (bool)testCtrlTabKeyEventIsPropagated:(id)engineMock {
|
376 | 379 | __block bool called = false;
|
377 | 380 | __block FlutterKeyEvent last_event;
|
378 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 381 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
379 | 382 | callback:nil
|
380 | 383 | userData:nil])
|
381 | 384 | .andDo((^(NSInvocation* invocation) {
|
@@ -419,7 +422,7 @@ - (bool)testCtrlTabKeyEventIsPropagated:(id)engineMock {
|
419 | 422 | - (bool)testKeyEquivalentIsPassedToTextInputPlugin:(id)engineMock {
|
420 | 423 | __block bool called = false;
|
421 | 424 | __block FlutterKeyEvent last_event;
|
422 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 425 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
423 | 426 | callback:nil
|
424 | 427 | userData:nil])
|
425 | 428 | .andDo((^(NSInvocation* invocation) {
|
@@ -471,7 +474,7 @@ - (bool)testKeyEventsArePropagatedIfNotHandled:(id)engineMock {
|
471 | 474 | OCMStub( // NOLINT(google-objc-avoid-throwing-exception)
|
472 | 475 | [engineMock binaryMessenger])
|
473 | 476 | .andReturn(binaryMessengerMock);
|
474 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 477 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
475 | 478 | callback:nil
|
476 | 479 | userData:nil])
|
477 | 480 | .andCall([FlutterViewControllerTestObjC class],
|
@@ -545,7 +548,7 @@ - (bool)testFlagsChangedEventsArePropagatedIfNotHandled:(id)engineMock {
|
545 | 548 | OCMStub( // NOLINT(google-objc-avoid-throwing-exception)
|
546 | 549 | [engineMock binaryMessenger])
|
547 | 550 | .andReturn(binaryMessengerMock);
|
548 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 551 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
549 | 552 | callback:nil
|
550 | 553 | userData:nil])
|
551 | 554 | .andCall([FlutterViewControllerTestObjC class],
|
@@ -598,7 +601,7 @@ - (bool)testKeyEventsAreNotPropagatedIfHandled:(id)engineMock {
|
598 | 601 | OCMStub( // NOLINT(google-objc-avoid-throwing-exception)
|
599 | 602 | [engineMock binaryMessenger])
|
600 | 603 | .andReturn(binaryMessengerMock);
|
601 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 604 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
602 | 605 | callback:nil
|
603 | 606 | userData:nil])
|
604 | 607 | .andCall([FlutterViewControllerTestObjC class],
|
@@ -655,7 +658,7 @@ - (bool)testKeyboardIsRestartedOnEngineRestart:(id)engineMock {
|
655 | 658 | .andReturn(binaryMessengerMock);
|
656 | 659 | __block bool called = false;
|
657 | 660 | __block FlutterKeyEvent last_event;
|
658 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 661 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
659 | 662 | callback:nil
|
660 | 663 | userData:nil])
|
661 | 664 | .andDo((^(NSInvocation* invocation) {
|
@@ -715,7 +718,7 @@ - (bool)testTrackpadGesturesAreSentToFramework:(id)engineMock {
|
715 | 718 | OCMStub([engineMock renderer]).andReturn(renderer_);
|
716 | 719 | __block bool called = false;
|
717 | 720 | __block FlutterPointerEvent last_event;
|
718 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendPointerEvent:FlutterPointerEvent{}]) |
| 721 | + OCMStub([[engineMock ignoringNonObjectArgs] sendPointerEvent:kDefaultFlutterPointerEvent]) |
719 | 722 | .andDo((^(NSInvocation* invocation) {
|
720 | 723 | FlutterPointerEvent* event;
|
721 | 724 | [invocation getArgument:&event atIndex:2];
|
@@ -1139,7 +1142,7 @@ - (bool)testModifierKeysAreSynthesizedOnMouseMove:(id)engineMock {
|
1139 | 1142 |
|
1140 | 1143 | // Capture calls to sendKeyEvent
|
1141 | 1144 | __block NSMutableArray<KeyEventWrapper*>* events = [NSMutableArray array];
|
1142 |
| - OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:FlutterKeyEvent {} |
| 1145 | + OCMStub([[engineMock ignoringNonObjectArgs] sendKeyEvent:kDefaultFlutterKeyEvent |
1143 | 1146 | callback:nil
|
1144 | 1147 | userData:nil])
|
1145 | 1148 | .andDo((^(NSInvocation* invocation) {
|
|
0 commit comments