This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
shell/platform/darwin/ios/framework/Source Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1200,9 +1200,10 @@ - (void)startKeyBoardAnimation:(NSTimeInterval)duration {
12001200 }
12011201 completion: ^(BOOL finished) {
12021202 if (self.displayLink == currentDisplayLink) {
1203+ // Indicates the displaylink captured by this block is the original one,which also
1204+ // indicates the animation has not been interrupted from its beginning. Moreover,indicates
1205+ // the animation is over and there is no more animation about to exectute.
12031206 [self invalidateDisplayLink ];
1204- }
1205- if (finished) {
12061207 [self removeKeyboardAnimationView ];
12071208 [self ensureViewportMetricsIsCorrect ];
12081209 }
Original file line number Diff line number Diff line change @@ -173,9 +173,17 @@ - (void)testkeyboardWillChangeFrameWillStartKeyboardAnimation {
173173 @" UIKeyboardAnimationDurationUserInfoKey" : [NSNumber numberWithDouble: 0.25 ],
174174 @" UIKeyboardIsLocalUserInfoKey" : [NSNumber numberWithBool: isLocal]
175175 }];
176+
177+ XCTestExpectation* expectation = [self expectationWithDescription: @" update viewport" ];
178+ OCMStub ([mockEngine updateViewportMetrics: flutter: :ViewportMetrics ()])
179+ .ignoringNonObjectArgs ()
180+ .andDo (^(NSInvocation * invocation) {
181+ [expectation fulfill ];
182+ });
176183 id viewControllerMock = OCMPartialMock (viewController);
177184 [viewControllerMock keyboardWillChangeFrame: notification];
178185 OCMVerify ([viewControllerMock startKeyBoardAnimation: 0.25 ]);
186+ [self waitForExpectationsWithTimeout: 5.0 handler: nil ];
179187}
180188
181189- (void )testEnsureViewportMetricsWillInvokeAndDisplayLinkWillInvalidateInViewDidDisappear {
You can’t perform that action at this time.
0 commit comments