cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [14/31] android commit: CB-7410 Fix Basic Authentication test
Date Thu, 11 Sep 2014 15:28:56 GMT
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/4.0.x
Commit: 4a7f825cfe829a1fd5a92402170fa233ec9211d6
Parents: 4bc2051
Author: Marcel Kinard <cmarcelk@gmail.com>
Authored: Fri Aug 29 16:38:38 2014 -0400
Committer: Marcel Kinard <cmarcelk@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");


Mime
View raw message