diff options
Diffstat (limited to 'Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp')
-rw-r--r-- | Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp index 620e6acd5..a19742c33 100644 --- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp @@ -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 @@ static String drtFrameDescription(WebCore::Frame* frame) 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,6 +864,20 @@ void DumpRenderTree::didReceiveResponseForFrame(WebCore::Frame* frame, const Web 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; +} + } } |