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

Public Member Functions

void setUp ()
 
void primaryResponderTest ()
 

Package Attributes

KeyEventChannel keyEventChannel
 
KeyChannelResponder channelResponder
 

Detailed Description

Definition at line 24 of file KeyChannelResponderTest.java.

Member Function Documentation

◆ primaryResponderTest()

void io.flutter.embedding.android.KeyChannelResponderTest.primaryResponderTest ( )
inline

Definition at line 36 of file KeyChannelResponderTest.java.

36 {
37 final int[] completionCallbackInvocationCounter = {0};
38
39 doAnswer(
40 invocation -> {
41 ((EventResponseHandler) invocation.getArgument(2)).onFrameworkResponse(true);
42 return null;
43 })
44 .when(keyEventChannel)
45 .sendFlutterKeyEvent(
46 any(FlutterKeyEvent.class), any(boolean.class), any(EventResponseHandler.class));
47
48 final KeyEvent keyEvent = new KeyEvent(KeyEvent.ACTION_DOWN, 65);
50 keyEvent,
51 (canHandleEvent) -> {
52 completionCallbackInvocationCounter[0]++;
53 });
54 assertEquals(completionCallbackInvocationCounter[0], 1);
55 }
void handleEvent( @NonNull KeyEvent keyEvent, @NonNull OnKeyEventHandledCallback onKeyEventHandledCallback)
SIT bool any(const Vec< 1, T > &x)
Definition: SkVx.h:530

◆ setUp()

void io.flutter.embedding.android.KeyChannelResponderTest.setUp ( )
inline

Definition at line 30 of file KeyChannelResponderTest.java.

30 {
31 MockitoAnnotations.openMocks(this);
32 channelResponder = new KeyChannelResponder(keyEventChannel);
33 }

Member Data Documentation

◆ channelResponder

KeyChannelResponder io.flutter.embedding.android.KeyChannelResponderTest.channelResponder
package

Definition at line 27 of file KeyChannelResponderTest.java.

◆ keyEventChannel

KeyEventChannel io.flutter.embedding.android.KeyChannelResponderTest.keyEventChannel
package

Definition at line 26 of file KeyChannelResponderTest.java.


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