Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format
  • Loading branch information
Gray Mackall committed Feb 21, 2024
commit 952037f5574de2dd45e2e7512c6014e90d442662
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.VisibleForTesting;

import io.flutter.Log;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
Expand Down Expand Up @@ -166,7 +165,7 @@ protected void onCreate(Bundle savedInstanceState) {
WindowManager windowManagerDelegate =
(WindowManager) getContext().getSystemService(WINDOW_SERVICE);
state.windowManagerHandler =
new WindowManagerHandler(windowManagerDelegate, state.fakeWindowViewGroup);
new WindowManagerHandler(windowManagerDelegate, state.fakeWindowViewGroup);
}

container = new FrameLayout(getContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
import android.view.inputmethod.InputMethodManager;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;

import java.util.concurrent.Executor;
import java.util.function.Consumer;

@Config(manifest = Config.NONE)
@RunWith(AndroidJUnit4.class)
@TargetApi(P)
Expand Down Expand Up @@ -97,14 +96,14 @@ public void returnsOuterContextInputMethodManager_createDisplayContext() {
public void windowManagerHandler_passesCorrectlyToFakeWindowViewGroup() {
// Mock the WindowManager and FakeWindowViewGroup that get used by the WindowManagerHandler.
WindowManager mockWindowManager = mock(WindowManager.class);
SingleViewPresentation.FakeWindowViewGroup mockFakeWindowViewGroup
= mock(SingleViewPresentation.FakeWindowViewGroup.class);
SingleViewPresentation.FakeWindowViewGroup mockFakeWindowViewGroup =
mock(SingleViewPresentation.FakeWindowViewGroup.class);

View mockView = mock(View.class);
ViewGroup.LayoutParams mockLayoutParams = mock(ViewGroup.LayoutParams.class);

SingleViewPresentation.WindowManagerHandler windowManagerHandler
= new SingleViewPresentation.WindowManagerHandler(mockWindowManager, mockFakeWindowViewGroup);
SingleViewPresentation.WindowManagerHandler windowManagerHandler =
new SingleViewPresentation.WindowManagerHandler(mockWindowManager, mockFakeWindowViewGroup);

// removeViewImmediate
windowManagerHandler.removeViewImmediate(mockView);
Expand Down Expand Up @@ -137,8 +136,8 @@ public void windowManagerHandler_logAndReturnEarly_whenFakeWindowViewGroupIsNull
View mockView = mock(View.class);
ViewGroup.LayoutParams mockLayoutParams = mock(ViewGroup.LayoutParams.class);

SingleViewPresentation.WindowManagerHandler windowManagerHandler
= new SingleViewPresentation.WindowManagerHandler(mockWindowManager, null);
SingleViewPresentation.WindowManagerHandler windowManagerHandler =
new SingleViewPresentation.WindowManagerHandler(mockWindowManager, null);

// removeViewImmediate
windowManagerHandler.removeViewImmediate(mockView);
Expand All @@ -163,11 +162,11 @@ public void windowManagerHandler_logAndReturnEarly_whenFakeWindowViewGroupIsNull
public void windowManagerHandler_forwardsAllOtherCallsToDelegate() {
// Mock the WindowManager and FakeWindowViewGroup that get used by the WindowManagerHandler.
WindowManager mockWindowManager = mock(WindowManager.class);
SingleViewPresentation.FakeWindowViewGroup mockFakeWindowViewGroup
= mock(SingleViewPresentation.FakeWindowViewGroup.class);
SingleViewPresentation.FakeWindowViewGroup mockFakeWindowViewGroup =
mock(SingleViewPresentation.FakeWindowViewGroup.class);

SingleViewPresentation.WindowManagerHandler windowManagerHandler
= new SingleViewPresentation.WindowManagerHandler(mockWindowManager, mockFakeWindowViewGroup);
SingleViewPresentation.WindowManagerHandler windowManagerHandler =
new SingleViewPresentation.WindowManagerHandler(mockWindowManager, mockFakeWindowViewGroup);

// Verify that all other calls get forwarded to the delegate.
Executor mockExecutor = mock(Executor.class);
Expand Down