1package io.flutter.embedding.engine;
3import static org.junit.Assert.assertEquals;
4import static org.mockito.Mockito.mock;
5import static org.mockito.Mockito.never;
6import static org.mockito.Mockito.times;
7import static org.mockito.Mockito.verify;
9import androidx.test.ext.junit.runners.AndroidJUnit4;
10import io.flutter.embedding.engine.renderer.FlutterRenderer;
11import io.flutter.embedding.engine.renderer.FlutterUiDisplayListener;
12import java.util.concurrent.atomic.AtomicInteger;
14import org.junit.runner.RunWith;
15import org.robolectric.annotation.Config;
18@RunWith(AndroidJUnit4.class)
26 AtomicInteger listenerInvocationCount =
new AtomicInteger(0);
30 public void onFlutterUiDisplayed() {
36 listenerInvocationCount.incrementAndGet();
40 public void onFlutterUiNoLongerDisplayed() {}
51 assertEquals(1, listenerInvocationCount.get());
69 verify(listener,
times(1)).onFlutterUiDisplayed();
90 verify(listener, never()).onFlutterUiDisplayed();
static SkISize times(const SkISize &size, float factor)
void onRenderingStopped()
void flutterUiDisplayListenersCanRemoveThemselvesWhenInvoked()
void flutterUiDisplayListenersAddedAfterFlutterUiDisappearsAreNotInvoked()
void flutterUiDisplayListenersAddedAfterFirstFrameAreAutomaticallyInvoked()
void removeIsDisplayingFlutterUiListener(@NonNull FlutterUiDisplayListener listener)
void addIsDisplayingFlutterUiListener(@NonNull FlutterUiDisplayListener listener)