Diff
Modified: trunk/LayoutTests/ChangeLog (203742 => 203743)
--- trunk/LayoutTests/ChangeLog 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/LayoutTests/ChangeLog 2016-07-26 22:31:25 UTC (rev 203743)
@@ -1,3 +1,14 @@
+2016-07-26 David Kilzer <ddkil...@apple.com>
+
+ Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+ https://bugs.webkit.org/show_bug.cgi?id=156947
+ <rdar://problem/23325160>
+
+ Reviewed by Alex Christensen.
+
+ * http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt: Added.
+ * http/tests/xmlhttprequest/auth-reject-protection-space.html: Added.
+
2016-07-26 Chris Dumez <cdu...@apple.com>
Parameters to CSSStyleSheet.insertRule() / deleteRule() should be mandatory
Added: trunk/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt (0 => 203743)
--- trunk/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt 2016-07-26 22:31:25 UTC (rev 203743)
@@ -0,0 +1,3 @@
+Simulating reject protection space and continue for authentication challenge
+ALERT: status: 401
+
Added: trunk/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space.html (0 => 203743)
--- trunk/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space.html (rev 0)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space.html 2016-07-26 22:31:25 UTC (rev 203743)
@@ -0,0 +1,17 @@
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ testRunner.setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(true);
+}
+var request = new XMLHttpRequest;
+request._onreadystatechange_ = function () {
+ if (request.readyState === 4) {
+ alert("status: " + request.status);
+ if (window.testRunner);
+ testRunner.notifyDone();
+ }
+};
+request.open('GET', 'resources/basic-auth/basic-auth.php');
+request.send(null);
+</script>
Modified: trunk/Source/WebCore/ChangeLog (203742 => 203743)
--- trunk/Source/WebCore/ChangeLog 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Source/WebCore/ChangeLog 2016-07-26 22:31:25 UTC (rev 203743)
@@ -1,3 +1,17 @@
+2016-07-26 David Kilzer <ddkil...@apple.com>
+
+ Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+ https://bugs.webkit.org/show_bug.cgi?id=156947
+ <rdar://problem/23325160>
+
+ Reviewed by Alex Christensen.
+
+ Test: http/tests/xmlhttprequest/auth-reject-protection-space.html
+
+ * platform/network/mac/AuthenticationMac.mm:
+ (-[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:]): Added.
+ (-[WebCoreAuthenticationClientAsChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]): Added.
+
2016-07-26 Chris Dumez <cdu...@apple.com>
Parameters to CSSStyleSheet.insertRule() / deleteRule() should be mandatory
Modified: trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm (203742 => 203743)
--- trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm 2016-07-26 22:31:25 UTC (rev 203743)
@@ -71,6 +71,18 @@
m_client = 0;
}
+- (void)performDefaultHandlingForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ if (m_client)
+ m_client->receivedRequestToPerformDefaultHandling(core(challenge));
+}
+
+- (void)rejectProtectionSpaceAndContinueWithChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ if (m_client)
+ m_client->receivedChallengeRejection(core(challenge));
+}
+
- (void)useCredential:(NSURLCredential *)credential forAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
if (m_client)
Modified: trunk/Source/WebKit2/ChangeLog (203742 => 203743)
--- trunk/Source/WebKit2/ChangeLog 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Source/WebKit2/ChangeLog 2016-07-26 22:31:25 UTC (rev 203743)
@@ -1,3 +1,17 @@
+2016-07-26 David Kilzer <ddkil...@apple.com>
+
+ Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+ https://bugs.webkit.org/show_bug.cgi?id=156947
+ <rdar://problem/23325160>
+
+ Reviewed by Alex Christensen.
+
+ * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
+ (WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue):
+ * UIProcess/API/C/WKAuthenticationDecisionListener.h:
+ Added new SPI for testing corresponding to calling the completion handler of
+ WKWebView.didReceiveAuthenticationChallenge with NSURLSessionAuthChallengeRejectProtectionSpace.
+
2016-07-26 Anders Carlsson <ander...@apple.com>
Payment session does not end if user closes all Safari windows
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp (203742 => 203743)
--- trunk/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp 2016-07-26 22:31:25 UTC (rev 203743)
@@ -46,3 +46,8 @@
{
toImpl(authenticationListener)->cancel();
}
+
+void WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(WKAuthenticationDecisionListenerRef authenticationListener)
+{
+ toImpl(authenticationListener)->rejectProtectionSpaceAndContinue();
+}
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h (203742 => 203743)
--- trunk/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h 2016-07-26 22:31:25 UTC (rev 203743)
@@ -36,6 +36,7 @@
WK_EXPORT void WKAuthenticationDecisionListenerUseCredential(WKAuthenticationDecisionListenerRef authenticationListener, WKCredentialRef credential);
WK_EXPORT void WKAuthenticationDecisionListenerCancel(WKAuthenticationDecisionListenerRef authenticationListener);
+WK_EXPORT void WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(WKAuthenticationDecisionListenerRef);
#ifdef __cplusplus
}
Modified: trunk/Tools/ChangeLog (203742 => 203743)
--- trunk/Tools/ChangeLog 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/ChangeLog 2016-07-26 22:31:25 UTC (rev 203743)
@@ -1,3 +1,32 @@
+2016-07-26 David Kilzer <ddkil...@apple.com>
+
+ Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+ https://bugs.webkit.org/show_bug.cgi?id=156947
+ <rdar://problem/23325160>
+
+ Reviewed by Alex Christensen.
+
+ * DumpRenderTree/TestRunner.cpp:
+ (TestRunner::TestRunner):
+ (setRejectsProtectionSpaceAndContinueForAuthenticationChallengesCallback):
+ * DumpRenderTree/TestRunner.h:
+ (TestRunner::rejectsProtectionSpaceAndContinueForAuthenticationChallenges):
+ (TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges):
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]):
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::queueNonLoadingScript):
+ (WTR::TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::didReceiveAuthenticationChallenge):
+ * WebKitTestRunner/TestController.h:
+ (WTR::TestController::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ Add TestRunner.setRejectsProtectionSpaceAndContinueForAuthenticationChallenges to use for testing.
+
2016-07-26 David Kilzer <ddkil...@apple.com>
check-for-exit-time-destructors should be usable outside Xcode
Modified: trunk/Tools/DumpRenderTree/TestRunner.cpp (203742 => 203743)
--- trunk/Tools/DumpRenderTree/TestRunner.cpp 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/DumpRenderTree/TestRunner.cpp 2016-07-26 22:31:25 UTC (rev 203743)
@@ -104,6 +104,7 @@
, m_globalFlag(false)
, m_isGeolocationPermissionSet(false)
, m_geolocationPermission(false)
+ , m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges(false)
, m_handlesAuthenticationChallenges(false)
, m_isPrinting(false)
, m_deferMainResourceDataLoad(true)
@@ -1064,6 +1065,18 @@
return JSValueMakeUndefined(context);
}
+static JSValueRef setRejectsProtectionSpaceAndContinueForAuthenticationChallengesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+ controller->setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setHandlesAuthenticationChallengesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -2128,6 +2141,7 @@
{ "setUseDeferredFrameLoading", setUseDeferredFrameLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setDomainRelaxationForbiddenForURLScheme", setDomainRelaxationForbiddenForURLSchemeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setGeolocationPermission", setGeolocationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setRejectsProtectionSpaceAndContinueForAuthenticationChallenges", setRejectsProtectionSpaceAndContinueForAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setHandlesAuthenticationChallenges", setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setIconDatabaseEnabled", setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAutomaticLinkDetectionEnabled", setAutomaticLinkDetectionEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
Modified: trunk/Tools/DumpRenderTree/TestRunner.h (203742 => 203743)
--- trunk/Tools/DumpRenderTree/TestRunner.h 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/DumpRenderTree/TestRunner.h 2016-07-26 22:31:25 UTC (rev 203743)
@@ -265,6 +265,9 @@
bool alwaysAcceptCookies() const { return m_alwaysAcceptCookies; }
void setAlwaysAcceptCookies(bool);
+ bool rejectsProtectionSpaceAndContinueForAuthenticationChallenges() const { return m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges; }
+ void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value) { m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges = value; }
+
bool handlesAuthenticationChallenges() const { return m_handlesAuthenticationChallenges; }
void setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { m_handlesAuthenticationChallenges = handlesAuthenticationChallenges; }
@@ -408,6 +411,7 @@
bool m_globalFlag;
bool m_isGeolocationPermissionSet;
bool m_geolocationPermission;
+ bool m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges;
bool m_handlesAuthenticationChallenges;
bool m_isPrinting;
bool m_deferMainResourceDataLoad;
Modified: trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm (203742 => 203743)
--- trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm 2016-07-26 22:31:25 UTC (rev 203743)
@@ -195,6 +195,13 @@
- (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
{
+ if (gTestRunner->rejectsProtectionSpaceAndContinueForAuthenticationChallenges()) {
+ printf("Simulating reject protection space and continue for authentication challenge\n");
+
+ [[challenge sender] rejectProtectionSpaceAndContinueWithChallenge:challenge];
+ return;
+ }
+
if (!gTestRunner->handlesAuthenticationChallenges()) {
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet", identifier];
printf("%s\n", [string UTF8String]);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (203742 => 203743)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2016-07-26 22:31:25 UTC (rev 203743)
@@ -199,6 +199,7 @@
void queueNonLoadingScript(DOMString script);
// Authentication
+ void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(boolean value);
void setHandlesAuthenticationChallenges(boolean value);
void setShouldLogCanAuthenticateAgainstProtectionSpace(boolean value);
void setAuthenticationUsername(DOMString username);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (203742 => 203743)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2016-07-26 22:31:25 UTC (rev 203743)
@@ -907,9 +907,16 @@
InjectedBundle::singleton().queueNonLoadingScript(scriptWK.get());
}
+void TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value)
+{
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetRejectsProtectionSpaceAndContinueForAuthenticationChallenges"));
+ WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
+ WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
+}
+
void TestRunner::setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges)
{
- WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetHandlesAuthenticationChallenge"));
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetHandlesAuthenticationChallenges"));
WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(handlesAuthenticationChallenges));
WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
}
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (203742 => 203743)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2016-07-26 22:31:25 UTC (rev 203743)
@@ -164,6 +164,7 @@
void setPrinting() { m_isPrinting = true; }
// Authentication
+ void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool);
void setHandlesAuthenticationChallenges(bool);
void setShouldLogCanAuthenticateAgainstProtectionSpace(bool);
void setAuthenticationUsername(JSStringRef);
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (203742 => 203743)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2016-07-26 22:31:25 UTC (rev 203743)
@@ -1611,6 +1611,12 @@
return;
}
+ if (m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges) {
+ m_currentInvocation->outputText("Simulating reject protection space and continue for authentication challenge\n");
+ WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(decisionListener);
+ return;
+ }
+
std::string host = toSTD(adoptWK(WKProtectionSpaceCopyHost(protectionSpace)).get());
int port = WKProtectionSpaceGetPort(protectionSpace);
String message = String::format("%s:%d - didReceiveAuthenticationChallenge - ", host.c_str(), port);
Modified: trunk/Tools/WebKitTestRunner/TestController.h (203742 => 203743)
--- trunk/Tools/WebKitTestRunner/TestController.h 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2016-07-26 22:31:25 UTC (rev 203743)
@@ -125,6 +125,7 @@
WorkQueueManager& workQueueManager() { return m_workQueueManager; }
+ void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value) { m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges = value; }
void setHandlesAuthenticationChallenges(bool value) { m_handlesAuthenticationChallenges = value; }
void setAuthenticationUsername(String username) { m_authenticationUsername = username; }
void setAuthenticationPassword(String password) { m_authenticationPassword = password; }
@@ -324,6 +325,7 @@
bool m_policyDelegateEnabled { false };
bool m_policyDelegatePermissive { false };
+ bool m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges { false };
bool m_handlesAuthenticationChallenges { false };
String m_authenticationUsername;
String m_authenticationPassword;
Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (203742 => 203743)
--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2016-07-26 22:04:02 UTC (rev 203742)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2016-07-26 22:31:25 UTC (rev 203743)
@@ -599,9 +599,16 @@
return;
}
- if (WKStringIsEqualToUTF8CString(messageName, "SetHandlesAuthenticationChallenge")) {
+ if (WKStringIsEqualToUTF8CString(messageName, "SetRejectsProtectionSpaceAndContinueForAuthenticationChallenges")) {
ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
WKBooleanRef value = static_cast<WKBooleanRef>(messageBody);
+ TestController::singleton().setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(WKBooleanGetValue(value));
+ return;
+ }
+
+ if (WKStringIsEqualToUTF8CString(messageName, "SetHandlesAuthenticationChallenges")) {
+ ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
+ WKBooleanRef value = static_cast<WKBooleanRef>(messageBody);
TestController::singleton().setHandlesAuthenticationChallenges(WKBooleanGetValue(value));
return;
}