@Test public void newInstance_whenActivityIsNull_throwsException() { Exception thrownException = null; AppCompatTestActivity appCompatTestActivity = Robolectric.setupActivity(AppCompatTestActivity.class); WebView webView = new WebView(appCompatTestActivity); try { PopupBridge.newInstance(null, webView); } catch (IllegalArgumentException e){ thrownException = e; } finally { assertEquals(thrownException.getMessage(), "Activity is null"); } }
@SuppressLint("SetJavaScriptEnabled") public static PopupBridge newInstance(AppCompatActivity activity, WebView webView) throws IllegalArgumentException { return newInstance((FragmentActivity)activity, webView); }
PopupBridge extends BrowserSwitchFragment { @SuppressLint("SetJavaScriptEnabled") public static PopupBridge newInstance(AppCompatActivity activity, WebView webView) throws IllegalArgumentException { return newInstance((FragmentActivity)activity, webView); } }
PopupBridge extends BrowserSwitchFragment { @SuppressLint("SetJavaScriptEnabled") public static PopupBridge newInstance(AppCompatActivity activity, WebView webView) throws IllegalArgumentException { return newInstance((FragmentActivity)activity, webView); } PopupBridge(); }
PopupBridge extends BrowserSwitchFragment { @SuppressLint("SetJavaScriptEnabled") public static PopupBridge newInstance(AppCompatActivity activity, WebView webView) throws IllegalArgumentException { return newInstance((FragmentActivity)activity, webView); } PopupBridge(); @SuppressLint("SetJavaScriptEnabled") static PopupBridge newInstance(AppCompatActivity activity, WebView webView); @SuppressLint("SetJavaScriptEnabled") static PopupBridge newInstance(FragmentActivity activity, WebView webView); @Override void onAttach(@NonNull Context context); @Override void onCreate(Bundle savedInstanceState); @Override void onBrowserSwitchResult(int requestCode, BrowserSwitchResult result, @Nullable Uri returnUri); @Override String getReturnUrlScheme(); @JavascriptInterface String getReturnUrlPrefix(); @JavascriptInterface void open(String url); @JavascriptInterface void sendMessage(String messageName); @JavascriptInterface void sendMessage(String messageName, String data); void setNavigationListener(PopupBridgeNavigationListener listener); void setMessageListener(PopupBridgeMessageListener listener); }
PopupBridge extends BrowserSwitchFragment { @SuppressLint("SetJavaScriptEnabled") public static PopupBridge newInstance(AppCompatActivity activity, WebView webView) throws IllegalArgumentException { return newInstance((FragmentActivity)activity, webView); } PopupBridge(); @SuppressLint("SetJavaScriptEnabled") static PopupBridge newInstance(AppCompatActivity activity, WebView webView); @SuppressLint("SetJavaScriptEnabled") static PopupBridge newInstance(FragmentActivity activity, WebView webView); @Override void onAttach(@NonNull Context context); @Override void onCreate(Bundle savedInstanceState); @Override void onBrowserSwitchResult(int requestCode, BrowserSwitchResult result, @Nullable Uri returnUri); @Override String getReturnUrlScheme(); @JavascriptInterface String getReturnUrlPrefix(); @JavascriptInterface void open(String url); @JavascriptInterface void sendMessage(String messageName); @JavascriptInterface void sendMessage(String messageName, String data); void setNavigationListener(PopupBridgeNavigationListener listener); void setMessageListener(PopupBridgeMessageListener listener); static final String POPUP_BRIDGE_NAME; static final String POPUP_BRIDGE_URL_HOST; }