Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
io.flutter.embedding.android.KeyboardChannelTest Class Reference

Public Member Functions

void respondsToGetKeyboardStateChannelMessage ()
 
void repliesWhenNoKeyboardChannelHandler ()
 

Detailed Description

Definition at line 24 of file KeyboardChannelTest.java.

Member Function Documentation

◆ repliesWhenNoKeyboardChannelHandler()

void io.flutter.embedding.android.KeyboardChannelTest.repliesWhenNoKeyboardChannelHandler ( )
inline

Definition at line 59 of file KeyboardChannelTest.java.

59 {
60 // Regression test for https://github.com/flutter/flutter/issues/122441#issuecomment-1582052616.
61
62 KeyboardChannel keyboardChannel = new KeyboardChannel(mock(DartExecutor.class));
63 MethodCall methodCall = new MethodCall("getKeyboardState", null);
64 MethodChannel.Result result = mock(MethodChannel.Result.class);
65 keyboardChannel.parsingMethodHandler.onMethodCall(methodCall, result);
66
67 verify(result).success(new HashMap());
68 }
static ::testing::Matcher< GBytes * > MethodCall(const std::string &name, ::testing::Matcher< FlValue * > args)
GAsyncResult * result

◆ respondsToGetKeyboardStateChannelMessage()

void io.flutter.embedding.android.KeyboardChannelTest.respondsToGetKeyboardStateChannelMessage ( )
inline

Definition at line 38 of file KeyboardChannelTest.java.

38 {
39 ArgumentCaptor<BinaryMessenger.BinaryMessageHandler> binaryMessageHandlerCaptor =
40 ArgumentCaptor.forClass(BinaryMessenger.BinaryMessageHandler.class);
41 DartExecutor mockBinaryMessenger = mock(DartExecutor.class);
42 KeyboardChannel.KeyboardMethodHandler mockHandler =
43 mock(KeyboardChannel.KeyboardMethodHandler.class);
44 KeyboardChannel keyboardChannel = new KeyboardChannel(mockBinaryMessenger);
45
46 verify(mockBinaryMessenger, times(1))
47 .setMessageHandler(any(String.class), binaryMessageHandlerCaptor.capture());
48
49 BinaryMessenger.BinaryMessageHandler binaryMessageHandler =
50 binaryMessageHandlerCaptor.getValue();
51
52 keyboardChannel.setKeyboardMethodHandler(mockHandler);
53 sendToBinaryMessageHandler(binaryMessageHandler, "getKeyboardState", null);
54
55 verify(mockHandler, times(1)).getKeyboardState();
56 }
static SkISize times(const SkISize &size, float factor)
SIT bool any(const Vec< 1, T > &x)
Definition: SkVx.h:530

The documentation for this class was generated from the following file: