@Test public void handleOpen_withApplicationUrl_shouldStartNewIntent() { String applicationUrl = "amzn: Robolectric.packageManager.addResolveInfoForIntent(new Intent(Intent.ACTION_VIEW, Uri .parse(applicationUrl)), new ResolveInfo()); subject.handleOpen(applicationUrl); Intent startedIntent = Robolectric.getShadowApplication().getNextStartedActivity(); assertThat(startedIntent).isNotNull(); assertThat(Utils.bitMaskContainsFlag(startedIntent.getFlags(), Intent.FLAG_ACTIVITY_NEW_TASK)).isTrue(); assertThat(startedIntent.getComponent()).isNull(); verify(mockMraidListener).onOpen(); }
@VisibleForTesting void handleOpen(@NonNull final String url) { if (mMraidListener != null) { mMraidListener.onOpen(); } new UrlHandler.Builder() .withSupportedUrlActions( UrlAction.IGNORE_ABOUT_SCHEME, UrlAction.OPEN_NATIVE_BROWSER, UrlAction.OPEN_IN_APP_BROWSER, UrlAction.HANDLE_SHARE_TWEET, UrlAction.FOLLOW_DEEP_LINK) .build().handleUrl(mContext, url); }
MraidController { @VisibleForTesting void handleOpen(@NonNull final String url) { if (mMraidListener != null) { mMraidListener.onOpen(); } new UrlHandler.Builder() .withSupportedUrlActions( UrlAction.IGNORE_ABOUT_SCHEME, UrlAction.OPEN_NATIVE_BROWSER, UrlAction.OPEN_IN_APP_BROWSER, UrlAction.HANDLE_SHARE_TWEET, UrlAction.FOLLOW_DEEP_LINK) .build().handleUrl(mContext, url); } }
MraidController { @VisibleForTesting void handleOpen(@NonNull final String url) { if (mMraidListener != null) { mMraidListener.onOpen(); } new UrlHandler.Builder() .withSupportedUrlActions( UrlAction.IGNORE_ABOUT_SCHEME, UrlAction.OPEN_NATIVE_BROWSER, UrlAction.OPEN_IN_APP_BROWSER, UrlAction.HANDLE_SHARE_TWEET, UrlAction.FOLLOW_DEEP_LINK) .build().handleUrl(mContext, url); } MraidController(@NonNull Context context, @Nullable AdReport adReport,
            @NonNull PlacementType placementType); @VisibleForTesting  MraidController(@NonNull Context context, @Nullable AdReport adReport,
            @NonNull PlacementType placementType,
            @NonNull MraidBridge bridge, @NonNull MraidBridge twoPartBridge,
            @NonNull ScreenMetricsWaiter screenMetricsWaiter); }
MraidController { @VisibleForTesting void handleOpen(@NonNull final String url) { if (mMraidListener != null) { mMraidListener.onOpen(); } new UrlHandler.Builder() .withSupportedUrlActions( UrlAction.IGNORE_ABOUT_SCHEME, UrlAction.OPEN_NATIVE_BROWSER, UrlAction.OPEN_IN_APP_BROWSER, UrlAction.HANDLE_SHARE_TWEET, UrlAction.FOLLOW_DEEP_LINK) .build().handleUrl(mContext, url); } MraidController(@NonNull Context context, @Nullable AdReport adReport,
            @NonNull PlacementType placementType); @VisibleForTesting  MraidController(@NonNull Context context, @Nullable AdReport adReport,
            @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(boolean isFinishing); void resume(); void destroy(); @NonNull FrameLayout getAdContainer(); void loadJavascript(@NonNull String javascript); @NonNull Context getContext(); }
MraidController { @VisibleForTesting void handleOpen(@NonNull final String url) { if (mMraidListener != null) { mMraidListener.onOpen(); } new UrlHandler.Builder() .withSupportedUrlActions( UrlAction.IGNORE_ABOUT_SCHEME, UrlAction.OPEN_NATIVE_BROWSER, UrlAction.OPEN_IN_APP_BROWSER, UrlAction.HANDLE_SHARE_TWEET, UrlAction.FOLLOW_DEEP_LINK) .build().handleUrl(mContext, url); } MraidController(@NonNull Context context, @Nullable AdReport adReport,
            @NonNull PlacementType placementType); @VisibleForTesting  MraidController(@NonNull Context context, @Nullable AdReport adReport,
            @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(boolean isFinishing); void resume(); void destroy(); @NonNull FrameLayout getAdContainer(); void loadJavascript(@NonNull String javascript); @NonNull Context getContext();  }