@Override public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.notification_error_ssl_cert_invalid); builder.setPositiveButton("continue", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.proceed(); } }); builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); } }); final AlertDialog dialog = builder.create(); dialog.show(); }
@Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { if (DISABLE_SSL_CHECK_FOR_TESTING) { handler.proceed(); } else { super.onReceivedSslError(view, handler, error); handler.cancel(); sendErrorToListener(new FacebookDialogException(null, ERROR_FAILED_SSL_HANDSHAKE, null)); } }
@Test public void shouldRecordCancel() { assertThat(shadow.wasCancelCalled()).isFalse(); handler.cancel(); assertThat(shadow.wasCancelCalled()).isTrue(); }
public void onClick(DialogInterface dialog, int which) { handler.cancel();
@Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); } });
@Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { if (DISABLE_SSL_CHECK_FOR_TESTING) { handler.proceed(); } else { super.onReceivedSslError(view, handler, error); handler.cancel(); } }
@Override public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { //super.onReceivedSslError(view, handler, error); AlertDialog.Builder builder = new AlertDialog.Builder(GroupsActivity.this); builder.setTitle("Invalid/Untrusted certificate"); builder.setMessage("You're accessing a page with an untrusted or invalid certificate. Do you want to continue?"); builder.setNegativeButton("Cancel", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); Toast.makeText(GroupsActivity.this, "Request cancelled", Toast.LENGTH_LONG).show(); } }); builder.setPositiveButton("Continue", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.proceed(); } }); }
myWebView.setWebViewClient(new WebViewClient() { @Override public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { final AlertDialog.Builder builder = new AlertDialog.Builder (MyActivity.this); builder.setMessage(R.string.sslerror_msg); builder.setPositiveButton("continue", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.proceed(); } }); builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); } }); final AlertDialog dialog = builder.create(); dialog.show(); } });
@Override public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.notification_error_ssl_cert_invalid); builder.setPositiveButton("continue", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.proceed(); } }); builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); } }); final AlertDialog dialog = builder.create(); dialog.show(); }
@Override public void onClick(final DialogInterface dialog, final int whichButton) { sslErrorDialogContinueButtonClicked = true; handler.cancel(); mWebEventListener.onAuthFailure(new AuthFailure(AuthFailure.TYPE_USER_INTERACTION, null)); } });
@Override public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.notification_error_ssl_cert_invalid); builder.setPositiveButton("continue", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.proceed(); } }); builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); } }); final AlertDialog dialog = builder.create(); dialog.show(); }
@Override public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.notification_error_ssl_cert_invalid); builder.setPositiveButton("continue", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.proceed(); } }); builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); } }); final AlertDialog dialog = builder.create(); dialog.show(); }
@Override public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.notification_error_ssl_cert_invalid); builder.setPositiveButton("continue", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.proceed(); } }); builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { handler.cancel(); } }); final AlertDialog dialog = builder.create(); dialog.show(); }
@Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { super.onReceivedSslError(view, handler, error); handler.cancel(); handler.proceed(); }
@Override public void onClick(DialogInterface dialog, int which) { handler.cancel();
@Override public void onClick(DialogInterface dialog, int which) { handler.cancel();
@Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { if (DISABLE_SSL_CHECK_FOR_TESTING) { handler.proceed(); } else { super.onReceivedSslError(view, handler, error); sendErrorToListener(new FacebookDialogException(null, ERROR_FAILED_SSL_HANDSHAKE, null)); handler.cancel(); WebDialog.this.dismiss(); } }
@Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { handler.cancel(); view.stopLoading(); mActivity.finishWithResult( ThreeDSecureAuthenticationResponse.fromException(error.toString())); } }
@Test public void onReceivedSslError_callsFinish() { SslErrorHandler handler = mock(SslErrorHandler.class); mWebViewClient.onReceivedSslError(mWebView, handler, mock(SslError.class)); verify(mWebView, times(1)).stopLoading(); verify(handler, times(1)).cancel(); verify(mActivity, times(1)).finishWithResult(any(ThreeDSecureAuthenticationResponse.class)); } }