@Test public void testBackPressed() { WebView webView = activity.findViewById(R.id.web_view); shadowOf(webView).getWebViewClient().onPageFinished(webView, "http: shadowOf(webView).setCanGoBack(true); assertTrue(activity.fragment.onBackPressed()); shadowOf(webView).setCanGoBack(false); assertFalse(activity.fragment.onBackPressed()); }
@Override public boolean onBackPressed() { if (mWebView.canGoBack()) { mWebView.goBack(); return true; } return false; }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { @Override public boolean onBackPressed() { if (mWebView.canGoBack()) { mWebView.goBack(); return true; } return false; } }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { @Override public boolean onBackPressed() { if (mWebView.canGoBack()) { mWebView.goBack(); return true; } return false; }  }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { @Override public boolean onBackPressed() { if (mWebView.canGoBack()) { mWebView.goBack(); return true; } return false; }  @Override void onAttach(Context context); @Override void onCreate(@Nullable Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState); @Override void onViewCreated(View view, @Nullable Bundle savedInstanceState); @Override boolean onOptionsItemSelected(MenuItem item); @Override void onResume(); @Override void onStop(); @Override void onSaveInstanceState(Bundle outState); @Override void onDestroy(); @Override void onDetach(); @Override void scrollToTop(); @Override boolean scrollToNext(); @Override boolean scrollToPrevious(); @Override boolean onBackPressed(); }
WebFragment extends LazyLoadFragment implements Scrollable, KeyDelegate.BackInterceptor { @Override public boolean onBackPressed() { if (mWebView.canGoBack()) { mWebView.goBack(); return true; } return false; }  @Override void onAttach(Context context); @Override void onCreate(@Nullable Bundle savedInstanceState); @Override View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState); @Override void onViewCreated(View view, @Nullable Bundle savedInstanceState); @Override boolean onOptionsItemSelected(MenuItem item); @Override void onResume(); @Override void onStop(); @Override void onSaveInstanceState(Bundle outState); @Override void onDestroy(); @Override void onDetach(); @Override void scrollToTop(); @Override boolean scrollToNext(); @Override boolean scrollToPrevious(); @Override boolean onBackPressed(); static final String EXTRA_ITEM; static final String PDF_LOADER_URL; }