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

Public Member Functions

void windowManagerHandler_passesCorrectlyToFakeWindowViewGroup ()
 
void windowManagerHandler_logAndReturnEarly_whenFakeWindowViewGroupIsNull ()
 
void windowManagerHandler_forwardsAllOtherCallsToDelegate ()
 

Detailed Description

Definition at line 26 of file WindowManagerHandlerTest.java.

Member Function Documentation

◆ windowManagerHandler_forwardsAllOtherCallsToDelegate()

void io.flutter.plugin.platform.WindowManagerHandlerTest.windowManagerHandler_forwardsAllOtherCallsToDelegate ( )
inline

Definition at line 98 of file WindowManagerHandlerTest.java.

98 {
99 // Mock the WindowManager and FakeWindowViewGroup that get used by the WindowManagerHandler.
100 WindowManager mockWindowManager = mock(WindowManager.class);
101 SingleViewFakeWindowViewGroup mockSingleViewFakeWindowViewGroup =
102 mock(SingleViewFakeWindowViewGroup.class);
103
104 WindowManagerHandler windowManagerHandler =
105 new WindowManagerHandler(mockWindowManager, mockSingleViewFakeWindowViewGroup);
106
107 // Verify that all other calls get forwarded to the delegate.
108 Executor mockExecutor = mock(Executor.class);
109 @SuppressWarnings("Unchecked cast")
110 Consumer<Boolean> mockListener = (Consumer<Boolean>) mock(Consumer.class);
111
112 windowManagerHandler.getDefaultDisplay();
113 verify(mockWindowManager).getDefaultDisplay();
114
115 windowManagerHandler.getCurrentWindowMetrics();
116 verify(mockWindowManager).getCurrentWindowMetrics();
117
118 windowManagerHandler.getMaximumWindowMetrics();
119 verify(mockWindowManager).getMaximumWindowMetrics();
120
121 windowManagerHandler.isCrossWindowBlurEnabled();
122 verify(mockWindowManager).isCrossWindowBlurEnabled();
123
124 windowManagerHandler.addCrossWindowBlurEnabledListener(mockListener);
125 verify(mockWindowManager).addCrossWindowBlurEnabledListener(mockListener);
126
127 windowManagerHandler.addCrossWindowBlurEnabledListener(mockExecutor, mockListener);
128 verify(mockWindowManager).addCrossWindowBlurEnabledListener(mockExecutor, mockListener);
129
130 windowManagerHandler.removeCrossWindowBlurEnabledListener(mockListener);
131 verify(mockWindowManager).removeCrossWindowBlurEnabledListener(mockListener);
132 }

◆ windowManagerHandler_logAndReturnEarly_whenFakeWindowViewGroupIsNull()

void io.flutter.plugin.platform.WindowManagerHandlerTest.windowManagerHandler_logAndReturnEarly_whenFakeWindowViewGroupIsNull ( )
inline

Definition at line 65 of file WindowManagerHandlerTest.java.

65 {
66 // Mock the WindowManager and FakeWindowViewGroup that get used by the WindowManagerHandler.
67 WindowManager mockWindowManager = mock(WindowManager.class);
68
69 View mockView = mock(View.class);
70 ViewGroup.LayoutParams mockLayoutParams = mock(ViewGroup.LayoutParams.class);
71
72 WindowManagerHandler windowManagerHandler = new WindowManagerHandler(mockWindowManager, null);
73
74 // removeViewImmediate
75 windowManagerHandler.removeViewImmediate(mockView);
76 verifyNoInteractions(mockView);
77 verifyNoInteractions(mockWindowManager);
78
79 // addView
80 windowManagerHandler.addView(mockView, mockLayoutParams);
81 verifyNoInteractions(mockWindowManager);
82
83 // updateViewLayout
84 windowManagerHandler.updateViewLayout(mockView, mockLayoutParams);
85 verifyNoInteractions(mockWindowManager);
86
87 // removeView
88 windowManagerHandler.updateViewLayout(mockView, mockLayoutParams);
89 verifyNoInteractions(mockWindowManager);
90 }

◆ windowManagerHandler_passesCorrectlyToFakeWindowViewGroup()

void io.flutter.plugin.platform.WindowManagerHandlerTest.windowManagerHandler_passesCorrectlyToFakeWindowViewGroup ( )
inline

Definition at line 29 of file WindowManagerHandlerTest.java.

29 {
30 // Mock the WindowManager and FakeWindowViewGroup that get used by the WindowManagerHandler.
31 WindowManager mockWindowManager = mock(WindowManager.class);
32 SingleViewFakeWindowViewGroup mockSingleViewFakeWindowViewGroup =
33 mock(SingleViewFakeWindowViewGroup.class);
34
35 View mockView = mock(View.class);
36 ViewGroup.LayoutParams mockLayoutParams = mock(ViewGroup.LayoutParams.class);
37
38 WindowManagerHandler windowManagerHandler =
39 new WindowManagerHandler(mockWindowManager, mockSingleViewFakeWindowViewGroup);
40
41 // removeViewImmediate
42 windowManagerHandler.removeViewImmediate(mockView);
43 verify(mockView).clearAnimation();
44 verify(mockSingleViewFakeWindowViewGroup).removeView(mockView);
45 verifyNoInteractions(mockWindowManager);
46
47 // addView
48 windowManagerHandler.addView(mockView, mockLayoutParams);
49 verify(mockSingleViewFakeWindowViewGroup).addView(mockView, mockLayoutParams);
50 verifyNoInteractions(mockWindowManager);
51
52 // updateViewLayout
53 windowManagerHandler.updateViewLayout(mockView, mockLayoutParams);
54 verify(mockSingleViewFakeWindowViewGroup).updateViewLayout(mockView, mockLayoutParams);
55 verifyNoInteractions(mockWindowManager);
56
57 // removeView
58 windowManagerHandler.updateViewLayout(mockView, mockLayoutParams);
59 verify(mockSingleViewFakeWindowViewGroup).removeView(mockView);
60 verifyNoInteractions(mockWindowManager);
61 }

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