MraidController { @VisibleForTesting void handlePageLoad() { setViewState(ViewState.DEFAULT, new Runnable() { @Override public void run() { mMraidBridge.notifySupports( mMraidNativeCommandHandler.isSmsAvailable(mContext), mMraidNativeCommandHandler.isTelAvailable(mContext), mMraidNativeCommandHandler.isCalendarAvailable(mContext), mMraidNativeCommandHandler.isStorePictureSupported(mContext), isInlineVideoAvailable()); mMraidBridge.notifyPlacementType(mPlacementType); mMraidBridge.notifyViewability(mMraidBridge.isVisible()); mMraidBridge.notifyReady(); } }); if (mMraidListener != null) { mMraidListener.onLoaded(mDefaultAdContainer); } } MraidController(@NonNull Context context, @NonNull AdConfiguration adConfiguration,
            @NonNull PlacementType placementType); @VisibleForTesting  MraidController(@NonNull Context context, @NonNull AdConfiguration adConfiguration,
            @NonNull PlacementType placementType,
            @NonNull MraidBridge bridge, @NonNull MraidBridge twoPartBridge,
            @NonNull ScreenMetricsWaiter screenMetricsWaiter); void setMraidListener(@Nullable MraidListener mraidListener); void setUseCustomCloseListener(@Nullable UseCustomCloseListener listener); void setDebugListener(@Nullable MraidWebViewDebugListener debugListener); void loadContent(@NonNull String htmlData); void pause(); void resume(); void destroy(); @NonNull FrameLayout getAdContainer(); void loadJavascript(@NonNull String javascript); @NonNull Context getContext();  }
@Test public void handlePageLoad_shouldNotifyBridgeOfVisibilityPlacementScreenSizeAndSupports() { when(mockBridge.isVisible()).thenReturn(true); subject.handlePageLoad(); verify(mockBridge).notifyViewability(true); verify(mockBridge).notifyPlacementType(PlacementType.INLINE); verify(mockBridge).notifyScreenMetrics(any(MraidScreenMetrics.class)); verify(mockBridge).notifySupports(false, false, false, false, false); }
@Test public void handlePageLoad_shouldCancelLastRequest() { subject.handlePageLoad(); verify(mockScreenMetricsWaiter).cancelLastRequest(); }