OAuthController implements OAuthWebViewClient.Listener { void setUpWebView(WebView webView, WebViewClient webViewClient, String url, WebChromeClient webChromeClient) { final WebSettings webSettings = webView.getSettings(); webSettings.setAllowFileAccess(false); webSettings.setJavaScriptEnabled(false); webSettings.setSaveFormData(false); webView.setVerticalScrollBarEnabled(false); webView.setHorizontalScrollBarEnabled(false); webView.setWebViewClient(webViewClient); webView.loadUrl(url); webView.setVisibility(View.INVISIBLE); webView.setWebChromeClient(webChromeClient); } OAuthController(ProgressBar spinner, WebView webView, TwitterAuthConfig authConfig,
            OAuth1aService oAuth1aService, Listener listener); @Override void onPageFinished(WebView webView, String url); @Override void onSuccess(Bundle bundle); @Override void onError(WebViewException exception);  }
@Test public void testSetUpWebView() { final WebViewClient mockWebClient = mock(WebViewClient.class); final WebChromeClient mockWebChromeClient = mock(WebChromeClient.class); controller.setUpWebView(mockWebView, mockWebClient, TEST_URL, mockWebChromeClient); verify(mockWebSettings).setJavaScriptEnabled(false); verify(mockWebSettings).setAllowFileAccess(false); verify(mockWebSettings).setSaveFormData(false); verify(mockWebView).setVerticalScrollBarEnabled(false); verify(mockWebView).setHorizontalScrollBarEnabled(false); verify(mockWebView).setWebViewClient(mockWebClient); verify(mockWebView).loadUrl(TEST_URL); verify(mockWebView).setVisibility(View.INVISIBLE); verify(mockWebView).setWebChromeClient(mockWebChromeClient); }