Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c38de84 authored by Steve Block's avatar Steve Block
Browse files

Implement WebViewClient.onReceivedHttpAuthRequest() in DumpRenderTree2

This fixes LayoutTest http/tests/appcache/auth.html.

Change-Id: Idd9ead9c35341cc6a787d409ae2fe1bebef01d60
parent 9e2f4096
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.os.PowerManager.WakeLock;
import android.util.Log;
import android.view.Window;
import android.webkit.ConsoleMessage;
import android.webkit.HttpAuthHandler;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
@@ -166,6 +167,19 @@ public class LayoutTestsExecutor extends Activity {
                onTestFinished();
            }
        }

         @Override
         public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler,
                 String host, String realm) {
             if (handler.useHttpAuthUsernamePassword() && view != null) {
                 String[] credentials = view.getHttpAuthUsernamePassword(host, realm);
                 if (credentials != null && credentials.length == 2) {
                     handler.proceed(credentials[0], credentials[1]);
                     return;
                 }
             }
             handler.cancel();
         }
    };

    private WebChromeClient mWebChromeClient = new WebChromeClient() {