<!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>[188988] trunk</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/188988">188988</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2015-08-26 14:15:49 -0700 (Wed, 26 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Crash when following a Google search link to Twitter with Limit Adult Content enabled
https://bugs.webkit.org/show_bug.cgi?id=147651
Rubber-stamped by Brady Eidson.
Tools:
Taught TestRunner how to decide the navigation policy after a delay.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForNavigationAction):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setShouldDecideNavigationPolicyAfterDelay):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::shouldDecideNavigationPolicyAfterDelay):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::decidePolicyForNavigationAction):
* WebKitTestRunner/TestController.h:
(WTR::TestController::setShouldDecideNavigationPolicyAfterDelay):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
LayoutTests:
Added a layout test.
* http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt: Added.
* http/tests/contentfiltering/load-substitute-data-from-appcache.html: Added.
* http/tests/contentfiltering/resources/appcache.html: Added.
* http/tests/contentfiltering/resources/appcache.manifest: Added.
* platform/mac-wk1/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcacheexpectedtxt">trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcachehtml">trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html</a></li>
<li><a href="#trunkLayoutTestshttptestscontentfilteringresourcesappcachehtml">trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.html</a></li>
<li><a href="#trunkLayoutTestshttptestscontentfilteringresourcesappcachemanifest">trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/LayoutTests/ChangeLog        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-08-26 Andy Estes <aestes@apple.com>
+
+ Crash when following a Google search link to Twitter with Limit Adult Content enabled
+ https://bugs.webkit.org/show_bug.cgi?id=147651
+
+ Rubber-stamped by Brady Eidson.
+
+ Added a layout test.
+
+ * http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt: Added.
+ * http/tests/contentfiltering/load-substitute-data-from-appcache.html: Added.
+ * http/tests/contentfiltering/resources/appcache.html: Added.
+ * http/tests/contentfiltering/resources/appcache.manifest: Added.
+ * platform/mac-wk1/TestExpectations:
+
</ins><span class="cx"> 2015-08-26 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Layout Test platform/mac/fast/events/content-inset-hit-testing-in-frame.html is flaky
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcacheexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt (0 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+This is a regression test for webkit.org/b/147651. The test passes if it does not crash.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentfilteringloadsubstitutedatafromappcachehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html (0 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html         (rev 0)
+++ trunk/LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.internals) {
+ var settings = window.internals.mockContentFilterSettings;
+ settings.enabled = true;
+ settings.decisionPoint = settings.DECISION_POINT_AFTER_ADD_DATA;
+ settings.decision = settings.DECISION_ALLOW;
+}
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ testRunner.setShouldDecideNavigationPolicyAfterDelay(true);
+}
+
+window.addEventListener("message", function() {
+ frames[0].location = "/resources/redirect.php?url=/contentfiltering/resources/appcache.html";
+});
+</script>
+<body>
+<p>This is a regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=147651">webkit.org/b/147651</a>. The test passes if it does not crash.</p>
+<iframe src="/contentfiltering/resources/appcache.html"></iframe>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentfilteringresourcesappcachehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.html (0 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.html         (rev 0)
+++ trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.html        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+<!DOCTYPE html>
+<html manifest="appcache.manifest">
+<script>
+applicationCache.onnoupdate = function() {
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+applicationCache.oncached = function() {
+ parent.postMessage("cached", "*");
+}
+</script>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentfilteringresourcesappcachemanifest"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest (0 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest         (rev 0)
+++ trunk/LayoutTests/http/tests/contentfiltering/resources/appcache.manifest        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+CACHE MANIFEST
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -141,3 +141,6 @@
</span><span class="cx">
</span><span class="cx"> ### END OF (2) Failures without bug reports
</span><span class="cx"> ########################################
</span><ins>+
+# This test is WebKit2-only
+http/tests/contentfiltering/load-substitute-data-from-appcache.html
</ins></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/ChangeLog        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-08-26 Andy Estes <aestes@apple.com>
+
+ Crash when following a Google search link to Twitter with Limit Adult Content enabled
+ https://bugs.webkit.org/show_bug.cgi?id=147651
+
+ Rubber-stamped by Brady Eidson.
+
+ Taught TestRunner how to decide the navigation policy after a delay.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::decidePolicyForNavigationAction):
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::setShouldDecideNavigationPolicyAfterDelay):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ (WTR::TestRunner::shouldDecideNavigationPolicyAfterDelay):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ (WTR::TestController::resetStateToConsistentValues):
+ (WTR::TestController::decidePolicyForNavigationAction):
+ * WebKitTestRunner/TestController.h:
+ (WTR::TestController::setShouldDecideNavigationPolicyAfterDelay):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+
</ins><span class="cx"> 2015-08-26 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] Rename 'WinLauncher' to 'MiniBrowser'
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx"> void setCacheModel(int model);
</span><span class="cx"> void setAsynchronousSpellCheckingEnabled(boolean value);
</span><span class="cx"> void setPrinting();
</span><ins>+ void setShouldDecideNavigationPolicyAfterDelay(boolean value);
</ins><span class="cx">
</span><span class="cx"> // Special DOM functions.
</span><span class="cx"> void clearBackForwardList();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -1286,6 +1286,9 @@
</span><span class="cx"> injectedBundle.outputText(stringBuilder.toString());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (injectedBundle.testRunner()->shouldDecideNavigationPolicyAfterDelay())
+ return WKBundlePagePolicyActionPassThrough;
+
</ins><span class="cx"> if (!injectedBundle.testRunner()->isPolicyDelegateEnabled())
</span><span class="cx"> return WKBundlePagePolicyActionUse;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -852,4 +852,12 @@
</span><span class="cx"> return JSC::setNeverInline(context, theFunction);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void TestRunner::setShouldDecideNavigationPolicyAfterDelay(bool value)
+{
+ m_shouldDecideNavigationPolicyAfterDelay = value;
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetShouldDecideNavigationPolicyAfterDelay"));
+ WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
+ WKBundlePagePostMessage(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get());
+}
+
</ins><span class="cx"> } // namespace WTR
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -283,6 +283,9 @@
</span><span class="cx"> JSValueRef numberOfDFGCompiles(JSValueRef theFunction);
</span><span class="cx"> JSValueRef neverInlineFunction(JSValueRef theFunction);
</span><span class="cx">
</span><ins>+ bool shouldDecideNavigationPolicyAfterDelay() const { return m_shouldDecideNavigationPolicyAfterDelay; }
+ void setShouldDecideNavigationPolicyAfterDelay(bool);
+
</ins><span class="cx"> private:
</span><span class="cx"> TestRunner();
</span><span class="cx">
</span><span class="lines">@@ -333,6 +336,8 @@
</span><span class="cx"> double m_databaseDefaultQuota;
</span><span class="cx"> double m_databaseMaxQuota;
</span><span class="cx">
</span><ins>+ bool m_shouldDecideNavigationPolicyAfterDelay { false };
+
</ins><span class="cx"> bool m_userStyleSheetEnabled;
</span><span class="cx"> WKRetainPtr<WKStringRef> m_userStyleSheetLocation;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> #include <ctype.h>
</span><span class="cx"> #include <stdlib.h>
</span><span class="cx"> #include <string>
</span><ins>+#include <wtf/RunLoop.h>
</ins><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -312,6 +313,8 @@
</span><span class="cx">
</span><span class="cx"> void TestController::initialize(int argc, const char* argv[])
</span><span class="cx"> {
</span><ins>+ RunLoop::initializeMainRunLoop();
+
</ins><span class="cx"> platformInitialize();
</span><span class="cx">
</span><span class="cx"> Options options;
</span><span class="lines">@@ -724,6 +727,8 @@
</span><span class="cx"> // Reset main page back to about:blank
</span><span class="cx"> m_doneResetting = false;
</span><span class="cx">
</span><ins>+ m_shouldDecideNavigationPolicyAfterDelay = false;
+
</ins><span class="cx"> WKPageLoadURL(m_mainWebView->page(), blankURL());
</span><span class="cx"> runUntil(m_doneResetting, shortTimeout);
</span><span class="cx"> return m_doneResetting;
</span><span class="lines">@@ -1493,12 +1498,19 @@
</span><span class="cx">
</span><span class="cx"> void TestController::decidePolicyForNavigationAction(WKFramePolicyListenerRef listener)
</span><span class="cx"> {
</span><del>- if (m_policyDelegateEnabled && !m_policyDelegatePermissive) {
- WKFramePolicyListenerIgnore(listener);
- return;
- }
</del><ins>+ WKRetainPtr<WKFramePolicyListenerRef> retainedListener { listener };
+ const bool shouldIgnore { m_policyDelegateEnabled && !m_policyDelegatePermissive };
+ std::function<void()> decisionFunction = [shouldIgnore, retainedListener]() {
+ if (shouldIgnore)
+ WKFramePolicyListenerIgnore(retainedListener.get());
+ else
+ WKFramePolicyListenerUse(retainedListener.get());
+ };
</ins><span class="cx">
</span><del>- WKFramePolicyListenerUse(listener);
</del><ins>+ if (m_shouldDecideNavigationPolicyAfterDelay)
+ RunLoop::main().dispatch(decisionFunction);
+ else
+ decisionFunction();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TestController::decidePolicyForNavigationResponse(WKPageRef, WKNavigationResponseRef navigationResponse, WKFramePolicyListenerRef listener, WKTypeRef, const void* clientInfo)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -124,6 +124,8 @@
</span><span class="cx">
</span><span class="cx"> bool isCurrentInvocation(TestInvocation* invocation) const { return invocation == m_currentInvocation.get(); }
</span><span class="cx">
</span><ins>+ void setShouldDecideNavigationPolicyAfterDelay(bool value) { m_shouldDecideNavigationPolicyAfterDelay = value; }
+
</ins><span class="cx"> private:
</span><span class="cx"> void initialize(int argc, const char* argv[]);
</span><span class="cx"> void createWebViewWithOptions(const ViewOptions&);
</span><span class="lines">@@ -285,6 +287,8 @@
</span><span class="cx"> bool m_shouldLogHistoryClientCallbacks;
</span><span class="cx"> bool m_shouldShowWebView;
</span><span class="cx">
</span><ins>+ bool m_shouldDecideNavigationPolicyAfterDelay { false };
+
</ins><span class="cx"> std::unique_ptr<EventSenderProxy> m_eventSenderProxy;
</span><span class="cx">
</span><span class="cx"> WorkQueueManager m_workQueueManager;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (188987 => 188988)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-08-26 20:44:04 UTC (rev 188987)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-08-26 21:15:49 UTC (rev 188988)
</span><span class="lines">@@ -628,6 +628,13 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (WKStringIsEqualToUTF8CString(messageName, "SetShouldDecideNavigationPolicyAfterDelay")) {
+ ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID());
+ WKBooleanRef value = static_cast<WKBooleanRef>(messageBody);
+ TestController::singleton().setShouldDecideNavigationPolicyAfterDelay(WKBooleanGetValue(value));
+ return;
+ }
+
</ins><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>