Diff
Modified: trunk/Source/WebCore/ChangeLog (118718 => 118719)
--- trunk/Source/WebCore/ChangeLog 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebCore/ChangeLog 2012-05-29 03:49:32 UTC (rev 118719)
@@ -1,5 +1,32 @@
2012-05-28 Jonathan Dong <[email protected]>
+ [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.
+
+ Resubmit the patch reverted by r115104 after the digest infinite loop
+ issue for BlackBerry porting get identified and fixed.
+
+ Internally reviewed by Joe Mason <[email protected]>
+
+ * platform/blackberry/PageClientBlackBerry.h:
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::sendRequestWithCredentials):
+
+2012-05-28 Jonathan Dong <[email protected]>
+
[BlackBerry] http authentication challenge issue when loading favicon
https://bugs.webkit.org/show_bug.cgi?id=87665
Modified: trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h (118718 => 118719)
--- trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebCore/platform/blackberry/PageClientBlackBerry.h 2012-05-29 03:49:32 UTC (rev 118719)
@@ -70,7 +70,7 @@
virtual int showAlertDialog(BlackBerry::WebKit::WebPageClient::AlertType) = 0;
virtual bool isActive() const = 0;
virtual bool isVisible() const = 0;
- virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&) = 0;
+ virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&) = 0;
virtual SaveCredentialType notifyShouldSaveCredential(bool) = 0;
};
Modified: trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp (118718 => 118719)
--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp 2012-05-29 03:49:32 UTC (rev 118719)
@@ -772,9 +772,6 @@
String username;
String password;
- if (!m_frame || !m_frame->loader() || !m_frame->loader()->client())
- return false;
-
if (type == ProtectionSpaceProxyHTTP) {
username = BlackBerry::Platform::Client::get()->getProxyUsername().c_str();
password = BlackBerry::Platform::Client::get()->getProxyPassword().c_str();
@@ -791,15 +788,14 @@
m_handle->getInternal()->m_user = "";
m_handle->getInternal()->m_pass = "";
} else {
- Credential inputCredential = m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace);
+ Credential inputCredential;
+ if (!m_frame->page()->chrome()->client()->platformPageClient()->authenticationChallenge(newURL, protectionSpace, inputCredential))
+ return false;
username = inputCredential.user();
password = inputCredential.password();
}
}
- if (username.isEmpty() && password.isEmpty())
- return false;
-
credential = Credential(username, password, CredentialPersistenceForSession);
m_handle->getInternal()->m_currentWebChallenge = AuthenticationChallenge(protectionSpace, credential, 0, m_response, ResourceError());
Modified: trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h (118718 => 118719)
--- trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebKit/blackberry/Api/DumpRenderTreeClient.h 2012-05-29 03:49:32 UTC (rev 118719)
@@ -25,6 +25,7 @@
#include <_javascript_Core/JSObjectRef.h>
namespace WebCore {
+class Credential;
class Frame;
class DOMWrapperWorld;
class NavigationAction;
@@ -81,6 +82,7 @@
virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, int insertAction) = 0;
virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, int insertAction) = 0;
virtual bool isSelectTrailingWhitespaceEnabled() const = 0;
+ virtual bool didReceiveAuthenticationChallenge(WebCore::Credential&) = 0;
};
}
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (118718 => 118719)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-05-29 03:49:32 UTC (rev 118719)
@@ -2135,26 +2135,32 @@
return m_client->isActive();
}
-Credential WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace)
+bool WebPagePrivate::authenticationChallenge(const KURL& url, const ProtectionSpace& protectionSpace, Credential& inputCredential)
{
WebString username;
WebString password;
+#if ENABLE_DRT
+ if (m_dumpRenderTree)
+ return m_dumpRenderTree->didReceiveAuthenticationChallenge(inputCredential);
+#endif
+
#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
if (!m_webSettings->isPrivateBrowsingEnabled())
credentialManager().autofillAuthenticationChallenge(protectionSpace, username, password);
#endif
- m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
+ bool isConfirmed = m_client->authenticationChallenge(protectionSpace.realm().characters(), protectionSpace.realm().length(), username, password);
#if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST)
- Credential inputCredential(username, password, CredentialPersistencePermanent);
- if (!m_webSettings->isPrivateBrowsingEnabled())
- credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, inputCredential));
+ Credential credential(username, password, CredentialPersistencePermanent);
+ if (!m_webSettings->isPrivateBrowsingEnabled() && isConfirmed)
+ credentialManager().saveCredentialIfConfirmed(this, CredentialTransformData(url, protectionSpace, credential));
#else
- Credential inputCredential(username, password, CredentialPersistenceNone);
+ Credential credential(username, password, CredentialPersistenceNone);
#endif
- return inputCredential;
+ inputCredential = credential;
+ return isConfirmed;
}
PageClientBlackBerry::SaveCredentialType WebPagePrivate::notifyShouldSaveCredential(bool isNew)
Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (118718 => 118719)
--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h 2012-05-29 03:49:32 UTC (rev 118719)
@@ -207,7 +207,7 @@
virtual void animateBlockZoom(const Platform::FloatPoint& finalPoint, double finalScale) = 0;
virtual void setPreventsScreenIdleDimming(bool noDimming) = 0;
- virtual void authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
+ virtual bool authenticationChallenge(const unsigned short* realm, unsigned int realmLength, WebString& username, WebString& password) = 0;
virtual SaveCredentialType notifyShouldSaveCredential(bool isNew) = 0;
virtual void notifyPopupAutofillDialog(const std::vector<std::string>&, const Platform::IntRect&) = 0;
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (118718 => 118719)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-05-29 03:49:32 UTC (rev 118719)
@@ -183,7 +183,7 @@
virtual int showAlertDialog(WebPageClient::AlertType atype);
virtual bool isActive() const;
virtual bool isVisible() const { return m_visible; }
- virtual WebCore::Credential authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&);
+ virtual bool authenticationChallenge(const WebCore::KURL&, const WebCore::ProtectionSpace&, WebCore::Credential&);
virtual SaveCredentialType notifyShouldSaveCredential(bool);
// Called from within WebKit via ChromeClientBlackBerry.
Modified: trunk/Source/WebKit/blackberry/ChangeLog (118718 => 118719)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-05-29 03:49:32 UTC (rev 118719)
@@ -1,3 +1,36 @@
+2012-05-28 Jonathan Dong <[email protected]>
+
+ [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.
+
+ Added the interface function didReceivedAuthenticaitonChallenge()
+ in interface class DumpRenderTreeClient;
+ Called m_dumpRenderTree->didReceiveAuthenticationChallenge() in
+ WebPagePrivate::authenticationChallenge() when DRT is enabled.
+
+ Test: reuse existing test cases:
+ http/tests/loading/basic-credentials-sent-automatically.html
+ http/tests/loading/basic-auth-resend-wrong-credentials.html
+
+ Resubmit the patch reverted by r115104 after the digest infinite loop
+ issue for BlackBerry porting get identified and fixed.
+
+ Internally reviewed by Joe Mason <[email protected]>
+
+ * Api/DumpRenderTreeClient.h:
+ (WebCore):
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):
+ * Api/WebPageClient.h:
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+
2012-05-28 Arvid Nilsson <[email protected]>
[BlackBerry] Always create a compositor
Modified: trunk/Tools/ChangeLog (118718 => 118719)
--- trunk/Tools/ChangeLog 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Tools/ChangeLog 2012-05-29 03:49:32 UTC (rev 118719)
@@ -1,3 +1,26 @@
+2012-05-28 Jonathan Dong <[email protected]>
+
+ [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.
+
+ Implemented interface function didReceiveAuthenticationChallenge in class
+ DumpRenderTree.
+
+ Resubmit the patch reverted by r115104 after the digest infinite loop
+ issue for BlackBerry porting get identified and fixed.
+
+ Internally reviewed by Joe Mason <[email protected]>
+
+ * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+ (drtCredentialDescription):
+ (BlackBerry::WebKit::DumpRenderTree::didReceiveAuthenticationChallenge):
+ (WebKit):
+ * DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h:
+ (WebCore):
+ (DumpRenderTree):
+
2012-05-25 Jesus Sanchez-Palencia <[email protected]>
WebKitTestRunner needs to support layoutTestController.setJavaScriptProfilingEnabled
Modified: trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp (118718 => 118719)
--- trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp 2012-05-29 03:49:32 UTC (rev 118719)
@@ -24,6 +24,7 @@
#include "BackForwardController.h"
#include "BackForwardListImpl.h"
#include "CString.h"
+#include "Credential.h"
#include "DatabaseTracker.h"
#include "DocumentLoader.h"
#include "DumpRenderTree/GCController.h"
@@ -124,6 +125,12 @@
return "frame (anonymous)";
}
+static WTF::String drtCredentialDescription(WebCore::Credential&)
+{
+ // TODO: Implementation needed.
+ return "<unknown>";
+}
+
static bool shouldLogFrameLoadDelegates(const String& url)
{
return url.contains("loading/");
@@ -857,8 +864,22 @@
printf("%s has MIME type %s\n", response.url().lastPathComponent().utf8().data(), response.mimeType().utf8().data());
}
+bool DumpRenderTree::didReceiveAuthenticationChallenge(WebCore::Credential& credential)
+{
+ if (!gLayoutTestController->handlesAuthenticationChallenges()) {
+ credential = WebCore::Credential();
+ printf("%s - didReceiveAuthenticationChallenge - Simulating cancelled authentication\n", drtCredentialDescription(credential).utf8().data());
+ return false;
+ }
+ const char* user = gLayoutTestController->authenticationUsername().c_str();
+ const char* password = gLayoutTestController->authenticationPassword().c_str();
+ credential = WebCore::Credential(user, password, WebCore::CredentialPersistenceForSession);
+ printf("%s - didReceiveAuthenticationChallenge - Responding with %s:%s\n", drtCredentialDescription(credential).utf8().data(), user, password);
+ return true;
}
+
}
+}
// Static dump() function required by cross-platform DRT code.
void dump()
Modified: trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h (118718 => 118719)
--- trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h 2012-05-29 03:24:49 UTC (rev 118718)
+++ trunk/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h 2012-05-29 03:49:32 UTC (rev 118719)
@@ -28,8 +28,9 @@
#include <wtf/Vector.h>
namespace WebCore {
+class Credential;
+class DOMWrapperWorld;
class Frame;
-class DOMWrapperWorld;
class Range;
}
@@ -101,6 +102,7 @@
bool isSelectTrailingWhitespaceEnabled() const { return s_selectTrailingWhitespaceEnabled; }
void setSelectTrailingWhitespaceEnabled(bool enabled) { s_selectTrailingWhitespaceEnabled = enabled; }
+ bool didReceiveAuthenticationChallenge(WebCore::Credential&);
private:
void runTest(const String& url);