@Test public void testOnProgress() { final Session session = mock(Session.class); final SessionCallbackProxy proxy = new SessionCallbackProxy(session, mock(IWebView.Callback.class)); proxy.onProgress(1); verify(session).setProgress(SessionCallbackProxy.MINIMUM_PROGRESS); proxy.onProgress(42); verify(session).setProgress(42); }
@Override public void onProgress(int progress) { progress = Math.max(MINIMUM_PROGRESS, progress); progress = Math.min(99, progress); session.setProgress(progress); }
SessionCallbackProxy implements IWebView.Callback { @Override public void onProgress(int progress) { progress = Math.max(MINIMUM_PROGRESS, progress); progress = Math.min(99, progress); session.setProgress(progress); } }
SessionCallbackProxy implements IWebView.Callback { @Override public void onProgress(int progress) { progress = Math.max(MINIMUM_PROGRESS, progress); progress = Math.min(99, progress); session.setProgress(progress); } SessionCallbackProxy(Session session, IWebView.Callback delegate); }
SessionCallbackProxy implements IWebView.Callback { @Override public void onProgress(int progress) { progress = Math.max(MINIMUM_PROGRESS, progress); progress = Math.min(99, progress); session.setProgress(progress); } SessionCallbackProxy(Session session, IWebView.Callback delegate); @Override void onPageStarted(@NonNull String url); @Override void onPageFinished(boolean isSecure); @Override void onProgress(int progress); @Override void onURLChanged(@NonNull String url); @Override void onRequest(boolean isTriggeredByUserGesture); @Override void onBlockingStateChanged(boolean isBlockingEnabled); @Override void onLongPress(@NonNull IWebView.HitTarget hitTarget); @Override void onShouldInterceptRequest(String url); @Override void onEnterFullScreen(@NonNull IWebView.FullscreenCallback callback, @Nullable View view); @Override void onExitFullScreen(); }
SessionCallbackProxy implements IWebView.Callback { @Override public void onProgress(int progress) { progress = Math.max(MINIMUM_PROGRESS, progress); progress = Math.min(99, progress); session.setProgress(progress); } SessionCallbackProxy(Session session, IWebView.Callback delegate); @Override void onPageStarted(@NonNull String url); @Override void onPageFinished(boolean isSecure); @Override void onProgress(int progress); @Override void onURLChanged(@NonNull String url); @Override void onRequest(boolean isTriggeredByUserGesture); @Override void onBlockingStateChanged(boolean isBlockingEnabled); @Override void onLongPress(@NonNull IWebView.HitTarget hitTarget); @Override void onShouldInterceptRequest(String url); @Override void onEnterFullScreen(@NonNull IWebView.FullscreenCallback callback, @Nullable View view); @Override void onExitFullScreen();  }