Definition at line 180 of file KeyboardManagerTest.java.
◆ KeyboardTester()
io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.KeyboardTester |
( |
| ) |
|
|
inline |
Definition at line 181 of file KeyboardManagerTest.java.
181 {
185
186 BinaryMessenger mockMessenger = mock(BinaryMessenger.class);
187 doAnswer(invocation -> onMessengerMessage(invocation))
188 .when(mockMessenger)
189 .send(
any(String.class),
any(ByteBuffer.class),
eq(
null));
190 doAnswer(invocation -> onMessengerMessage(invocation))
191 .when(mockMessenger)
192 .send(
any(String.class),
any(ByteBuffer.class),
any(BinaryMessenger.BinaryReply.class));
193
194 mockView = mock(KeyboardManager.ViewDelegate.class);
195 doAnswer(invocation -> mockMessenger).when(
mockView).getBinaryMessenger();
196 doAnswer(invocation -> textInputResult)
198 .onTextInputKeyEvent(
any(KeyEvent.class));
199 doAnswer(
200 invocation -> {
201 KeyEvent event = invocation.getArgument(0);
203 assertEquals(handled, false);
204 return null;
205 })
207 .redispatch(
any(KeyEvent.class));
208
210 }
static bool eq(const SkM44 &a, const SkM44 &b, float tol)
void respondToEmbedderCallsWith(boolean handled)
KeyboardManager keyboardManager
void respondToChannelCallsWith(boolean handled)
KeyboardManager.ViewDelegate mockView
void respondToTextInputWith(boolean response)
boolean handleEvent(@NonNull KeyEvent keyEvent)
SIT bool any(const Vec< 1, T > &x)
◆ recordChannelCallsTo()
void io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.recordChannelCallsTo |
( |
@NonNull ArrayList< CallRecord > |
storage | ) |
|
|
inline |
Record channel calls to the given storage.
They are not responded to until the stored callbacks are manually called.
Definition at line 230 of file KeyboardManagerTest.java.
230 {
231 channelHandler =
232 (JSONObject
data, Consumer<Boolean> reply) -> {
233 storage.add(CallRecord.channelCall(
data, reply));
234 };
235 }
std::shared_ptr< const fml::Mapping > data
◆ recordEmbedderCallsTo()
void io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.recordEmbedderCallsTo |
( |
@NonNull ArrayList< CallRecord > |
storage | ) |
|
|
inline |
Record embedder calls to the given storage.
They are not responded to until the stored callbacks are manually called.
Definition at line 252 of file KeyboardManagerTest.java.
252 {
253 embedderHandler =
254 (KeyData keyData, Consumer<Boolean> reply) ->
255 storage.add(CallRecord.embedderCall(keyData, reply));
256 }
◆ respondToChannelCallsWith()
void io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.respondToChannelCallsWith |
( |
boolean |
handled | ) |
|
|
inline |
Set channel calls to respond immediately with the given response.
Definition at line 216 of file KeyboardManagerTest.java.
216 {
217 channelHandler =
218 (JSONObject
data, Consumer<Boolean> reply) -> {
219 if (reply != null) {
220 reply.accept(handled);
221 }
222 };
223 }
◆ respondToEmbedderCallsWith()
void io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.respondToEmbedderCallsWith |
( |
boolean |
handled | ) |
|
|
inline |
Set embedder calls to respond immediately with the given response.
Definition at line 238 of file KeyboardManagerTest.java.
238 {
239 embedderHandler =
240 (KeyData keyData, Consumer<Boolean> reply) -> {
241 if (reply != null) {
242 reply.accept(handled);
243 }
244 };
245 }
◆ respondToTextInputWith()
void io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.respondToTextInputWith |
( |
boolean |
response | ) |
|
|
inline |
Set text calls to respond with the given response.
Definition at line 259 of file KeyboardManagerTest.java.
259 {
260 textInputResult = response;
261 }
◆ keyboardManager
KeyboardManager io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.keyboardManager |
◆ mockView
KeyboardManager.ViewDelegate io.flutter.embedding.android.KeyboardManagerTest.KeyboardTester.mockView |
The documentation for this class was generated from the following file: