You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2014/08/29 22:42:42 UTC
android commit: CB-7410 Fix Basic Authentication test
Repository: cordova-android
Updated Branches:
refs/heads/master 4bc2051f4 -> 4a7f825cf
CB-7410 Fix Basic Authentication test
Looks like the Chromium webview does not include the port number on the
hostname during the callback challenge, but the classic webview does
include the port number. Handle both cases here.
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/4a7f825c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/4a7f825c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/4a7f825c
Branch: refs/heads/master
Commit: 4a7f825cfe829a1fd5a92402170fa233ec9211d6
Parents: 4bc2051
Author: Marcel Kinard <cm...@gmail.com>
Authored: Fri Aug 29 16:38:38 2014 -0400
Committer: Marcel Kinard <cm...@gmail.com>
Committed: Fri Aug 29 16:41:51 2014 -0400
----------------------------------------------------------------------
test/src/org/apache/cordova/test/basicauth.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/4a7f825c/test/src/org/apache/cordova/test/basicauth.java
----------------------------------------------------------------------
diff --git a/test/src/org/apache/cordova/test/basicauth.java b/test/src/org/apache/cordova/test/basicauth.java
index 1b09f3d..a0aaa7c 100755
--- a/test/src/org/apache/cordova/test/basicauth.java
+++ b/test/src/org/apache/cordova/test/basicauth.java
@@ -21,7 +21,7 @@ package org.apache.cordova.test;
import android.os.Bundle;
import org.apache.cordova.*;
-public class basicauth extends DroidGap {
+public class basicauth extends CordovaActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -31,11 +31,13 @@ public class basicauth extends DroidGap {
AuthenticationToken token = new AuthenticationToken();
token.setUserName("test");
token.setPassword("test");
- super.setAuthenticationToken(token, "browserspy.dk:80", "BrowserSpy.dk - HTTP Password Test");
+ // classic webview includes port in hostname, Chromium webview does not. Handle both here.
+ // BTW, the realm is optional.
+ setAuthenticationToken(token, "browserspy.dk:80", "BrowserSpy.dk - HTTP Password Test");
+ setAuthenticationToken(token, "browserspy.dk", "BrowserSpy.dk - HTTP Password Test");
// Add web site to whitelist
- Config.init();
- Config.addWhiteListEntry("http://browserspy.dk*", true);
+ Config.getWhitelist().addWhiteListEntry("http://browserspy.dk/*", true);
// Load test
super.loadUrl("file:///android_asset/www/basicauth/index.html");