Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
io.flutter.plugin.mouse.MouseCursorPluginTest Class Reference

Public Member Functions

void mouseCursorPlugin_SetsSystemCursorOnRequest () throws JSONException
 

Detailed Description

Definition at line 33 of file MouseCursorPluginTest.java.

Member Function Documentation

◆ mouseCursorPlugin_SetsSystemCursorOnRequest()

void io.flutter.plugin.mouse.MouseCursorPluginTest.mouseCursorPlugin_SetsSystemCursorOnRequest ( ) throws JSONException
inline

Definition at line 39 of file MouseCursorPluginTest.java.

39 {
40 // Migrate to ActivityScenario by following https://github.com/robolectric/robolectric/pull/4736
41 // Initialize a general MouseCursorPlugin.
42 FlutterView testView = spy(new FlutterView(Robolectric.setupActivity(Activity.class)));
43 MouseCursorChannel mouseCursorChannel = new MouseCursorChannel(mock(DartExecutor.class));
44
45 MouseCursorPlugin mouseCursorPlugin = new MouseCursorPlugin(testView, mouseCursorChannel);
46
47 final StoredResult methodResult = new StoredResult();
48 mouseCursorChannel.synthesizeMethodCall(
49 new MethodCall(
50 "activateSystemCursor",
51 new HashMap<String, Object>() {
52 private static final long serialVersionUID = 1L;
53
54 {
55 put("device", 1);
56 put("kind", "text");
57 }
58 }),
59 methodResult);
60 verify(testView, times(1)).getSystemPointerIcon(PointerIcon.TYPE_TEXT);
61 verify(testView, times(1)).setPointerIcon(any(PointerIcon.class));
62 assertEquals(methodResult.result, Boolean.TRUE);
63 }
static SkISize times(const SkISize &size, float factor)
static ::testing::Matcher< GBytes * > MethodCall(const std::string &name, ::testing::Matcher< FlValue * > args)
SIT bool any(const Vec< 1, T > &x)
Definition: SkVx.h:530

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