BaseOAuthFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) { loginWebView = new WebView(getActivity()); try { loginWebView.getSettings().setJavaScriptEnabled(true); } catch (Exception e) { } loginWebView.setWebViewClient(getWebViewClient()); return loginWebView; }  @Override View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState); WebViewClient getWebViewClient(); TokenGet getTokenAsyncTask(String authCode); @Override void onStart(); void superOnStart(); void startLogin(); String buildLoginUrl(); void finishAuthorization(); abstract String getLoginUrl(); abstract String getScope(); abstract String getTokenUrl(); abstract String getClientId(); abstract String getClientSecret(); abstract String getRedirectUri(); abstract String getGrantType(); abstract void saveAuthToken(String authToken, long expire, String refreshToken, String userId); public WebView loginWebView; }
@Test public void test_onCreateView() { View view = fragment.onCreateView(fragment.getActivity().getLayoutInflater(), null, null); assertNotNull(view); assertTrue(view instanceof WebView); }