From fb83fdf30a33b5afe51c478bf989aab0e6b92b69 Mon Sep 17 00:00:00 2001
From: "commit-queue@webkit.org"
Date: Sat, 31 Mar 2012 13:34:04 +0000
Subject: [PATCH] [BlackBerry] http authenticate dialog popup only once no
matter authentication pass or fail
https://bugs.webkit.org/show_bug.cgi?id=80135
Patch by Jonathan Dong on 2012-03-31
Reviewed by Rob Buis.
.:
RIM PR: 145660
Added manual test for testing the behavior of http authentication
challenge dialog. Both of these two files should be served over http.
* ManualTests/blackberry/http-auth-challenge.html: Added.
* ManualTests/blackberry/http-auth-challenge.php: Added.
Source/WebCore:
RIM PR: 145660
Fixed a regression introduced by r111810, we should cancel the new
request when user press cancel button in http authentication challenge
dialog, and we should also allow sending empty username and password
with the request.
Also removed redundant codes which checked the existence of the
FrameLoaderClient pointer, as we've already moved authenticationChallenge()
out of class FrameLoaderClient, it is not needed.
Manual test added. Testing http authentication dialog relies on user interaction.
* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::sendRequestWithCredentials):
Source/WebKit/blackberry:
RIM PR: 145660
Fixed a regression introduced by r111810, which used the wrong
credential object.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
---
ChangeLog | 14 +++++++++++
ManualTests/blackberry/http-auth-challenge.html | 24 +++++++++++++++++++
ManualTests/blackberry/http-auth-challenge.php | 27 ++++++++++++++++++++++
Source/WebCore/ChangeLog | 21 +++++++++++++++++
.../platform/network/blackberry/NetworkJob.cpp | 15 +++++-------
Source/WebKit/blackberry/Api/WebPage.cpp | 2 +-
Source/WebKit/blackberry/ChangeLog | 14 +++++++++++
7 files changed, 107 insertions(+), 10 deletions(-)
create mode 100644 ManualTests/blackberry/http-auth-challenge.html
create mode 100644 ManualTests/blackberry/http-auth-challenge.php
diff --git a/ChangeLog b/ChangeLog
index 0c69ede..d70d067 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-03-31 Jonathan Dong
+
+ [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
+ https://bugs.webkit.org/show_bug.cgi?id=80135
+
+ Reviewed by Rob Buis.
+
+ RIM PR: 145660
+ Added manual test for testing the behavior of http authentication
+ challenge dialog. Both of these two files should be served over http.
+
+ * ManualTests/blackberry/http-auth-challenge.html: Added.
+ * ManualTests/blackberry/http-auth-challenge.php: Added.
+
2012-03-30 Eli Fidler
Enable OpenType Sanitizer for BlackBerry port.
diff --git a/ManualTests/blackberry/http-auth-challenge.html b/ManualTests/blackberry/http-auth-challenge.html
new file mode 100644
index 0000000..07de1a2
--- /dev/null
+++ b/ManualTests/blackberry/http-auth-challenge.html
@@ -0,0 +1,24 @@
+
+
+ To run this test, both http-auth-challenge.html and http-auth-challenge.php must be served over http.
+ This test case is to test the behavior of http authentication challenge dialog. This is for https://bugs.webkit.org/show_bug.cgi?id=80135
+
+ Please follow the following test procedure:
+
+ - Test dialog behavior when press Cancel button
+
+ - Start test case, then press Cancel button when authentication dialog pops up;
+
+ - Test dialog behavior when press OK button
+
+ - Navigate back to the privious page;
+ - Start test case again, then press Ok button without input anything when authentication dialog pops up;
+ - When dialog pops up again, enter fake credential and press Ok button: username:"qqqq", password:"qqqq"
+ - When dialog pops up agian, enter real credential and press Ok button: username:"aaaa", password:"aaaa"
+
+
+ Start test here
+
+
+
+
diff --git a/ManualTests/blackberry/http-auth-challenge.php b/ManualTests/blackberry/http-auth-challenge.php
new file mode 100644
index 0000000..776396c
--- /dev/null
+++ b/ManualTests/blackberry/http-auth-challenge.php
@@ -0,0 +1,27 @@
+PASS";
+ else
+ echo "FAIL";
+ exit;
+ } else {
+ header('WWW-Authenticate: Basic realm="My Realm"');
+ header('HTTP/1.0 401 Unauthorized');
+ echo "Auth dialog behavior when press Cancel button: ";
+ if ($_SESSION['triedTimes'] == 1)
+ echo "PASS";
+ else
+ echo "FAIL";
+ exit;
+ }
+?>
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 31b0b0e..a9d1e14 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2012-03-31 Jonathan Dong
+
+ [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
+ https://bugs.webkit.org/show_bug.cgi?id=80135
+
+ Reviewed by Rob Buis.
+
+ RIM PR: 145660
+ Fixed a regression introduced by r111810, we should cancel the new
+ request when user press cancel button in http authentication challenge
+ dialog, and we should also allow sending empty username and password
+ with the request.
+ Also removed redundant codes which checked the existence of the
+ FrameLoaderClient pointer, as we've already moved authenticationChallenge()
+ out of class FrameLoaderClient, it is not needed.
+
+ Manual test added. Testing http authentication dialog relies on user interaction.
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::sendRequestWithCredentials):
+
2012-03-31 Charles Wei
[BlackBerry] Upstream BlackBerry change to PlatformTouchEvent and PlatformTouchPoint
diff --git a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
index 34863f6..a4bafd4 100644
--- a/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
+++ b/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
@@ -849,9 +849,6 @@ bool NetworkJob::sendRequestWithCredentials(ProtectionSpaceServerType type, Prot
String username;
String password;
- if (!m_frame || !m_frame->loader() || !m_frame->loader()->client())
- return false;
-
// Before asking the user for credentials, we check if the URL contains that.
if (!m_handle->getInternal()->m_user.isEmpty() && !m_handle->getInternal()->m_pass.isEmpty()) {
username = m_handle->getInternal()->m_user.utf8().data();
@@ -863,12 +860,12 @@ bool NetworkJob::sendRequestWithCredentials(ProtectionSpaceServerType type, Prot
m_handle->getInternal()->m_pass = "";
} else {
Credential inputCredential;
- bool isConfirmed = false;
- do {
- isConfirmed = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace, inputCredential);
- username = inputCredential.user();
- password = inputCredential.password();
- } while (isConfirmed && username.isEmpty() && password.isEmpty());
+ bool isConfirmed = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace, inputCredential);
+ username = inputCredential.user();
+ password = inputCredential.password();
+
+ if (!isConfirmed)
+ return false;
}
credential = Credential(username, password, CredentialPersistenceForSession);
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index 391300a..a07e8bf 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -2026,7 +2026,7 @@ bool WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSp
#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
Credential credential(username, password, CredentialPersistencePermanent);
if (!m_webSettings->isPrivateBrowsingEnabled())
- credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, inputCredential));
+ credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, credential));
#else
Credential credential(username, password, CredentialPersistenceNone);
#endif
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index e9acf99..bbe56d5 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,17 @@
+2012-03-31 Jonathan Dong
+
+ [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
+ https://bugs.webkit.org/show_bug.cgi?id=80135
+
+ Reviewed by Rob Buis.
+
+ RIM PR: 145660
+ Fixed a regression introduced by r111810, which used the wrong
+ credential object.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):
+
2012-03-30 Mike Fenton
[BlackBerry] Speed up processing of Selection region generation.
--
1.8.3.1