<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[203884] branches/safari-602-branch</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203884">203884</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2016-07-29 00:12:37 -0700 (Fri, 29 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/203743">r203743</a>. rdar://problem/23325160</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari602branchLayoutTestsChangeLog">branches/safari-602-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebCoreChangeLog">branches/safari-602-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebCoreplatformnetworkmacAuthenticationMacmm">branches/safari-602-branch/Source/WebCore/platform/network/mac/AuthenticationMac.mm</a></li>
<li><a href="#branchessafari602branchSourceWebKit2ChangeLog">branches/safari-602-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebKit2UIProcessAPICWKAuthenticationDecisionListenercpp">branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebKit2UIProcessAPICWKAuthenticationDecisionListenerh">branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h</a></li>
<li><a href="#branchessafari602branchToolsChangeLog">branches/safari-602-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari602branchToolsDumpRenderTreeTestRunnercpp">branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.cpp</a></li>
<li><a href="#branchessafari602branchToolsDumpRenderTreeTestRunnerh">branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.h</a></li>
<li><a href="#branchessafari602branchToolsDumpRenderTreemacResourceLoadDelegatemm">branches/safari-602-branch/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm</a></li>
<li><a href="#branchessafari602branchToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl">branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl</a></li>
<li><a href="#branchessafari602branchToolsWebKitTestRunnerInjectedBundleTestRunnercpp">branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#branchessafari602branchToolsWebKitTestRunnerInjectedBundleTestRunnerh">branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href="#branchessafari602branchToolsWebKitTestRunnerTestControllercpp">branches/safari-602-branch/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#branchessafari602branchToolsWebKitTestRunnerTestControllerh">branches/safari-602-branch/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#branchessafari602branchToolsWebKitTestRunnerTestInvocationcpp">branches/safari-602-branch/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari602branchLayoutTestshttptestsxmlhttprequestauthrejectprotectionspaceexpectedtxt">branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestshttptestsxmlhttprequestauthrejectprotectionspacehtml">branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari602branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/LayoutTests/ChangeLog (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/ChangeLog        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/LayoutTests/ChangeLog        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2016-07-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r203743. rdar://problem/23325160
+
+    2016-07-26  David Kilzer &lt;ddkilzer@apple.com&gt;
+
+            Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+            https://bugs.webkit.org/show_bug.cgi?id=156947
+            &lt;rdar://problem/23325160&gt;
+
+            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-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
</ins><span class="cx">         Merge r203752. rdar://problem/27557968
</span><span class="cx"> 
</span><span class="cx">     2016-07-26  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602branchLayoutTestshttptestsxmlhttprequestauthrejectprotectionspaceexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt (0 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space-expected.txt        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+Simulating reject protection space and continue for authentication challenge
+ALERT: status: 401
+
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestshttptestsxmlhttprequestauthrejectprotectionspacehtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space.html (0 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space.html                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/http/tests/xmlhttprequest/auth-reject-protection-space.html        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+    testRunner.setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(true);
+}
+var request = new XMLHttpRequest;
+request.onreadystatechange = function () {
+    if (request.readyState === 4) {
+        alert(&quot;status: &quot; + request.status);
+        if (window.testRunner);
+            testRunner.notifyDone();
+    }
+};
+request.open('GET', 'resources/basic-auth/basic-auth.php');
+request.send(null);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="branchessafari602branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/ChangeLog        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2016-07-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r203743. rdar://problem/23325160
+
+    2016-07-26  David Kilzer &lt;ddkilzer@apple.com&gt;
+
+            Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+            https://bugs.webkit.org/show_bug.cgi?id=156947
+            &lt;rdar://problem/23325160&gt;
+
+            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-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
</ins><span class="cx">         Merge r203855. rdar://problem/27557968
</span><span class="cx"> 
</span><span class="cx">     2016-07-28  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCoreplatformnetworkmacAuthenticationMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/platform/network/mac/AuthenticationMac.mm (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/platform/network/mac/AuthenticationMac.mm        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Source/WebCore/platform/network/mac/AuthenticationMac.mm        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -71,6 +71,18 @@
</span><span class="cx">     m_client = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)performDefaultHandlingForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+    if (m_client)
+        m_client-&gt;receivedRequestToPerformDefaultHandling(core(challenge));
+}
+
+- (void)rejectProtectionSpaceAndContinueWithChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+    if (m_client)
+        m_client-&gt;receivedChallengeRejection(core(challenge));
+}
+
</ins><span class="cx"> - (void)useCredential:(NSURLCredential *)credential forAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
</span><span class="cx"> {
</span><span class="cx">     if (m_client)
</span></span></pre></div>
<a id="branchessafari602branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebKit2/ChangeLog (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebKit2/ChangeLog        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Source/WebKit2/ChangeLog        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2016-07-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r203743. rdar://problem/23325160
+
+    2016-07-26  David Kilzer &lt;ddkilzer@apple.com&gt;
+
+            Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+            https://bugs.webkit.org/show_bug.cgi?id=156947
+            &lt;rdar://problem/23325160&gt;
+
+            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-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
</ins><span class="cx">         Merge r203855. rdar://problem/27557968
</span><span class="cx"> 
</span><span class="cx">     2016-07-28  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602branchSourceWebKit2UIProcessAPICWKAuthenticationDecisionListenercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -46,3 +46,8 @@
</span><span class="cx"> {
</span><span class="cx">     toImpl(authenticationListener)-&gt;cancel();
</span><span class="cx"> }
</span><ins>+
+void WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(WKAuthenticationDecisionListenerRef authenticationListener)
+{
+    toImpl(authenticationListener)-&gt;rejectProtectionSpaceAndContinue();
+}
</ins></span></pre></div>
<a id="branchessafari602branchSourceWebKit2UIProcessAPICWKAuthenticationDecisionListenerh"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKAuthenticationDecisionListenerUseCredential(WKAuthenticationDecisionListenerRef authenticationListener, WKCredentialRef credential);
</span><span class="cx"> WK_EXPORT void WKAuthenticationDecisionListenerCancel(WKAuthenticationDecisionListenerRef authenticationListener);
</span><ins>+WK_EXPORT void WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(WKAuthenticationDecisionListenerRef);
</ins><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari602branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/ChangeLog (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/ChangeLog        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/ChangeLog        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -1,5 +1,38 @@
</span><span class="cx"> 2016-07-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r203743. rdar://problem/23325160
+
+    2016-07-26  David Kilzer &lt;ddkilzer@apple.com&gt;
+
+            Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
+            https://bugs.webkit.org/show_bug.cgi?id=156947
+            &lt;rdar://problem/23325160&gt;
+
+            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-28  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
</ins><span class="cx">         Merge r203855. rdar://problem/27557968
</span><span class="cx"> 
</span><span class="cx">     2016-07-28  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602branchToolsDumpRenderTreeTestRunnercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.cpp (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.cpp        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.cpp        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -104,6 +104,7 @@
</span><span class="cx">     , m_globalFlag(false)
</span><span class="cx">     , m_isGeolocationPermissionSet(false)
</span><span class="cx">     , m_geolocationPermission(false)
</span><ins>+    , m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges(false)
</ins><span class="cx">     , m_handlesAuthenticationChallenges(false)
</span><span class="cx">     , m_isPrinting(false)
</span><span class="cx">     , m_deferMainResourceDataLoad(true)
</span><span class="lines">@@ -1064,6 +1065,18 @@
</span><span class="cx">     return JSValueMakeUndefined(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef setRejectsProtectionSpaceAndContinueForAuthenticationChallengesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    // Has mac &amp; windows implementation
+    if (argumentCount &lt; 1)
+        return JSValueMakeUndefined(context);
+    
+    TestRunner* controller = static_cast&lt;TestRunner*&gt;(JSObjectGetPrivate(thisObject));
+    controller-&gt;setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(JSValueToBoolean(context, arguments[0]));
+    
+    return JSValueMakeUndefined(context);
+}
+
</ins><span class="cx"> static JSValueRef setHandlesAuthenticationChallengesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     // Has mac &amp; windows implementation
</span><span class="lines">@@ -2128,6 +2141,7 @@
</span><span class="cx">         { &quot;setUseDeferredFrameLoading&quot;, setUseDeferredFrameLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;setDomainRelaxationForbiddenForURLScheme&quot;, setDomainRelaxationForbiddenForURLSchemeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;setGeolocationPermission&quot;, setGeolocationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><ins>+        { &quot;setRejectsProtectionSpaceAndContinueForAuthenticationChallenges&quot;, setRejectsProtectionSpaceAndContinueForAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx">         { &quot;setHandlesAuthenticationChallenges&quot;, setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;setIconDatabaseEnabled&quot;, setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;setAutomaticLinkDetectionEnabled&quot;, setAutomaticLinkDetectionEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span></span></pre></div>
<a id="branchessafari602branchToolsDumpRenderTreeTestRunnerh"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.h (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.h        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/DumpRenderTree/TestRunner.h        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -265,6 +265,9 @@
</span><span class="cx">     bool alwaysAcceptCookies() const { return m_alwaysAcceptCookies; }
</span><span class="cx">     void setAlwaysAcceptCookies(bool);
</span><span class="cx">     
</span><ins>+    bool rejectsProtectionSpaceAndContinueForAuthenticationChallenges() const { return m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges; }
+    void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value) { m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges = value; }
+    
</ins><span class="cx">     bool handlesAuthenticationChallenges() const { return m_handlesAuthenticationChallenges; }
</span><span class="cx">     void setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { m_handlesAuthenticationChallenges = handlesAuthenticationChallenges; }
</span><span class="cx">     
</span><span class="lines">@@ -408,6 +411,7 @@
</span><span class="cx">     bool m_globalFlag;
</span><span class="cx">     bool m_isGeolocationPermissionSet;
</span><span class="cx">     bool m_geolocationPermission;
</span><ins>+    bool m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges;
</ins><span class="cx">     bool m_handlesAuthenticationChallenges;
</span><span class="cx">     bool m_isPrinting;
</span><span class="cx">     bool m_deferMainResourceDataLoad;
</span></span></pre></div>
<a id="branchessafari602branchToolsDumpRenderTreemacResourceLoadDelegatemm"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -195,6 +195,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
</span><span class="cx"> {
</span><ins>+    if (gTestRunner-&gt;rejectsProtectionSpaceAndContinueForAuthenticationChallenges()) {
+        printf(&quot;Simulating reject protection space and continue for authentication challenge\n&quot;);
+
+        [[challenge sender] rejectProtectionSpaceAndContinueWithChallenge:challenge];
+        return;
+    }
+
</ins><span class="cx">     if (!gTestRunner-&gt;handlesAuthenticationChallenges()) {
</span><span class="cx">         NSString *string = [NSString stringWithFormat:@&quot;%@ - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet&quot;, identifier];
</span><span class="cx">         printf(&quot;%s\n&quot;, [string UTF8String]);
</span></span></pre></div>
<a id="branchessafari602branchToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -199,6 +199,7 @@
</span><span class="cx">     void queueNonLoadingScript(DOMString script);
</span><span class="cx"> 
</span><span class="cx">     // Authentication
</span><ins>+    void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(boolean value);
</ins><span class="cx">     void setHandlesAuthenticationChallenges(boolean value);
</span><span class="cx">     void setShouldLogCanAuthenticateAgainstProtectionSpace(boolean value);
</span><span class="cx">     void setAuthenticationUsername(DOMString username);
</span></span></pre></div>
<a id="branchessafari602branchToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -907,9 +907,16 @@
</span><span class="cx">     InjectedBundle::singleton().queueNonLoadingScript(scriptWK.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestRunner::setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value)
+{
+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetRejectsProtectionSpaceAndContinueForAuthenticationChallenges&quot;));
+    WKRetainPtr&lt;WKBooleanRef&gt; messageBody(AdoptWK, WKBooleanCreate(value));
+    WKBundlePagePostMessage(InjectedBundle::singleton().page()-&gt;page(), messageName.get(), messageBody.get());
+}
+    
</ins><span class="cx"> void TestRunner::setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges)
</span><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetHandlesAuthenticationChallenge&quot;));
</del><ins>+    WKRetainPtr&lt;WKStringRef&gt; messageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;SetHandlesAuthenticationChallenges&quot;));
</ins><span class="cx">     WKRetainPtr&lt;WKBooleanRef&gt; messageBody(AdoptWK, WKBooleanCreate(handlesAuthenticationChallenges));
</span><span class="cx">     WKBundlePagePostMessage(InjectedBundle::singleton().page()-&gt;page(), messageName.get(), messageBody.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari602branchToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -164,6 +164,7 @@
</span><span class="cx">     void setPrinting() { m_isPrinting = true; }
</span><span class="cx"> 
</span><span class="cx">     // Authentication
</span><ins>+    void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool);
</ins><span class="cx">     void setHandlesAuthenticationChallenges(bool);
</span><span class="cx">     void setShouldLogCanAuthenticateAgainstProtectionSpace(bool);
</span><span class="cx">     void setAuthenticationUsername(JSStringRef);
</span></span></pre></div>
<a id="branchessafari602branchToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/WebKitTestRunner/TestController.cpp (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/WebKitTestRunner/TestController.cpp        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/WebKitTestRunner/TestController.cpp        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -1618,6 +1618,12 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges) {
+        m_currentInvocation-&gt;outputText(&quot;Simulating reject protection space and continue for authentication challenge\n&quot;);
+        WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(decisionListener);
+        return;
+    }
+
</ins><span class="cx">     std::string host = toSTD(adoptWK(WKProtectionSpaceCopyHost(protectionSpace)).get());
</span><span class="cx">     int port = WKProtectionSpaceGetPort(protectionSpace);
</span><span class="cx">     String message = String::format(&quot;%s:%d - didReceiveAuthenticationChallenge - &quot;, host.c_str(), port);
</span></span></pre></div>
<a id="branchessafari602branchToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/WebKitTestRunner/TestController.h (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/WebKitTestRunner/TestController.h        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/WebKitTestRunner/TestController.h        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx"> 
</span><span class="cx">     WorkQueueManager&amp; workQueueManager() { return m_workQueueManager; }
</span><span class="cx"> 
</span><ins>+    void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value) { m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges = value; }
</ins><span class="cx">     void setHandlesAuthenticationChallenges(bool value) { m_handlesAuthenticationChallenges = value; }
</span><span class="cx">     void setAuthenticationUsername(String username) { m_authenticationUsername = username; }
</span><span class="cx">     void setAuthenticationPassword(String password) { m_authenticationPassword = password; }
</span><span class="lines">@@ -324,6 +325,7 @@
</span><span class="cx">     bool m_policyDelegateEnabled { false };
</span><span class="cx">     bool m_policyDelegatePermissive { false };
</span><span class="cx"> 
</span><ins>+    bool m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges { false };
</ins><span class="cx">     bool m_handlesAuthenticationChallenges { false };
</span><span class="cx">     String m_authenticationUsername;
</span><span class="cx">     String m_authenticationPassword;
</span></span></pre></div>
<a id="branchessafari602branchToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Tools/WebKitTestRunner/TestInvocation.cpp (203883 => 203884)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Tools/WebKitTestRunner/TestInvocation.cpp        2016-07-29 07:12:30 UTC (rev 203883)
+++ branches/safari-602-branch/Tools/WebKitTestRunner/TestInvocation.cpp        2016-07-29 07:12:37 UTC (rev 203884)
</span><span class="lines">@@ -599,9 +599,16 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetHandlesAuthenticationChallenge&quot;)) {
</del><ins>+    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetRejectsProtectionSpaceAndContinueForAuthenticationChallenges&quot;)) {
</ins><span class="cx">         ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
</span><span class="cx">         WKBooleanRef value = static_cast&lt;WKBooleanRef&gt;(messageBody);
</span><ins>+        TestController::singleton().setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(WKBooleanGetValue(value));
+        return;
+    }
+
+    if (WKStringIsEqualToUTF8CString(messageName, &quot;SetHandlesAuthenticationChallenges&quot;)) {
+        ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
+        WKBooleanRef value = static_cast&lt;WKBooleanRef&gt;(messageBody);
</ins><span class="cx">         TestController::singleton().setHandlesAuthenticationChallenges(WKBooleanGetValue(value));
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>