You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by na...@apache.org on 2014/10/02 20:17:37 UTC

[03/29] git commit: CB-7410 Fix Basic Authentication test

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-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/ccc4a57c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/ccc4a57c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/ccc4a57c

Branch: refs/heads/master
Commit: ccc4a57c0f4e4a556891d9ad90c3af85533eab80
Parents: c980bbc
Author: Marcel Kinard <cm...@gmail.com>
Authored: Fri Aug 29 16:38:38 2014 -0400
Committer: Prabhjot Singh <pr...@amazon.com>
Committed: Wed Sep 17 09:48:28 2014 +0530

----------------------------------------------------------------------
 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-amazon-fireos/blob/ccc4a57c/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");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org