<!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>[188828] 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/188828">188828</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-08-22 15:20:46 -0700 (Sat, 22 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebKitTestRunner should use WKWebView on OS X and iOS
https://bugs.webkit.org/show_bug.cgi?id=143743
&lt;rdar://problem/16947123&gt;

Reviewed by Anders Carlsson.
Patch by Enrica Casucci and myself.

* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::windowSnapshotEnabled): Deleted.
Add a PlatformWebView constructor that takes a WKWebViewConfiguration
instead of WKContext and WKPageGroup.

Remove the unused, always-true windowSnapshotEnabled().
While technically some platforms don't have window snapshotting,
they just return null instead of implementing windowSnapshotEnabled().

* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::initialize):
(WTR::TestController::createWebViewWithOptions):
Delegate to the various platforms for creating PlatformWebView instances,
for creating WKContexts, and for accessing WKPreferences,
so that they can do special things (like, use WKWebView instead!).

(WTR::TestController::resetPreferencesToConsistentValues):
Make explicit WebKitTestRunner's desired default for two preferences
which have differing defaults between the antique and modern API,
for consistency's sake.

(WTR::TestController::resetStateToConsistentValues):
Add platformResetStateToConsistentValues.

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::dumpResults):
Adjust to the aforementioned removal of windowSnapshotEnabled().

* WebKitTestRunner/ios/TestControllerCocoa.mm:
(WTR::TestController::platformResetStateToConsistentValues):
(WTR::TestController::platformPreferences):
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
(WTR::TestController::platformInitializeConfiguration):
Implement the new platform functions for the Modern WebKit2 API,
in a new TestControllerCocoa file that is shared between iOS and Mac.

For platformMaybeCreateContext, use the trick that we know we can cast
the WKProcessPool to a WKContextRef to retrieve a WKContextRef from
WKWebView's configuration.

Ditto for WKPreferencesRef and WKPreferences.

Remove user content filters on the WKWebView's userContentController.

* WebKitTestRunner/mac/TestControllerMac.mm:
* WebKitTestRunner/ios/TestControllerIOS.mm:
Move code into TestControllerCocoa.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::addUserScript):
(WTR::TestRunner::addUserStyleSheet):
Adopt WKBundlePage API for user scripts/sheets.

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
Make and keep a WKWebView instead of a WKView.

* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
Reach inside the WKWebView to the WKView when dispatching events.
This is fairly ugly and we should come up with a better solution.
Also, fix some flipping and style errors.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _windowOcclusionDetectionEnabled]):
(-[WKWebView _setWindowOcclusionDetectionEnabled:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add SPI to disable window occlusion detection, for WebKitTestRunner's use.

* Shared/WebPreferencesDefinitions.h:
Remove a completely unused WebPreference. It is a WebCore Setting,
but in the API it's exposed as a WKPage setter and WKView and WKWebView property
instead of as a WKPreference, so there's no need for the WebPreference.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageAddUserScript):
(WKBundlePageAddUserStyleSheet):
(WKBundlePageRemoveAllUserContent):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addUserScript):
(WebKit::WebPage::addUserStyleSheet):
(WebKit::WebPage::removeAllUserContent):
* WebProcess/WebPage/WebPage.h:
Add WKBundlePage functions for user script and style sheet manipulation.
These use the WebPage's WebUserContentController instead of the WebPageGroupProxy's
(used by the WKBundle functions), so they work correctly with the modern API.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagePrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerPlatformWebViewh">trunk/Tools/WebKitTestRunner/PlatformWebView.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>
<li><a href="#trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojectpbxproj">trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsWebKitTestRunnereflTestControllerEflcpp">trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnergtkTestControllerGtkcpp">trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosPlatformWebViewIOSmm">trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosTestControllerIOSmm">trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacEventSenderProxymm">trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacPlatformWebViewMacmm">trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacTestControllerMacmm">trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsWebKitTestRunnercocoaTestControllerCocoamm">trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/ChangeLog        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2015-08-22  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        WebKitTestRunner should use WKWebView on OS X and iOS
+        https://bugs.webkit.org/show_bug.cgi?id=143743
+        &lt;rdar://problem/16947123&gt;
+
+        Reviewed by Anders Carlsson.
+        Patch by Enrica Casucci and myself.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _windowOcclusionDetectionEnabled]):
+        (-[WKWebView _setWindowOcclusionDetectionEnabled:]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        Add SPI to disable window occlusion detection, for WebKitTestRunner's use.
+
+        * Shared/WebPreferencesDefinitions.h:
+        Remove a completely unused WebPreference. It is a WebCore Setting,
+        but in the API it's exposed as a WKPage setter and WKView and WKWebView property
+        instead of as a WKPreference, so there's no need for the WebPreference.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageAddUserScript):
+        (WKBundlePageAddUserStyleSheet):
+        (WKBundlePageRemoveAllUserContent):
+        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::addUserScript):
+        (WebKit::WebPage::addUserStyleSheet):
+        (WebKit::WebPage::removeAllUserContent):
+        * WebProcess/WebPage/WebPage.h:
+        Add WKBundlePage functions for user script and style sheet manipulation.
+        These use the WebPage's WebUserContentController instead of the WebPageGroupProxy's
+        (used by the WKBundle functions), so they work correctly with the modern API.
+
</ins><span class="cx"> 2015-08-22  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, attempt to fix GTK build after r188718
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -180,7 +180,6 @@
</span><span class="cx">     macro(ThreadedScrollingEnabled, threadedScrollingEnabled, Bool, bool, true) \
</span><span class="cx">     macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \
</span><span class="cx">     macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, false) \
</span><del>-    macro(BackgroundShouldExtendBeyondPage, backgroundShouldExtendBeyondPage, Bool, bool, false) \
</del><span class="cx">     macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \
</span><span class="cx">     macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false) \
</span><span class="cx">     macro(SpatialNavigationEnabled, spatialNavigationEnabled, Bool, bool, false) \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -3083,6 +3083,16 @@
</span><span class="cx">     return [_wkView _topContentInset];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)_windowOcclusionDetectionEnabled
+{
+    return [_wkView windowOcclusionDetectionEnabled];
+}
+
+- (void)_setWindowOcclusionDetectionEnabled:(BOOL)flag
+{
+    [_wkView setWindowOcclusionDetectionEnabled:flag];
+}
+
</ins><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span><span class="cx"> 
</span><span class="cx"> - (void)_setAutomaticallyAdjustsContentInsets:(BOOL)automaticallyAdjustsContentInsets
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -173,6 +173,9 @@
</span><span class="cx"> 
</span><span class="cx"> // Default value is 0. A value of 0 means the window's backing scale factor will be used and automatically update when the window moves screens.
</span><span class="cx"> @property (nonatomic, setter=_setOverrideDeviceScaleFactor:) CGFloat _overrideDeviceScaleFactor WK_AVAILABLE(WK_MAC_TBA, NA);
</span><ins>+
+@property (nonatomic, setter=_setWindowOcclusionDetectionEnabled:) BOOL _windowOcclusionDetectionEnabled;
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> - (void)_killWebContentProcessAndResetState;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -615,3 +615,18 @@
</span><span class="cx">     if (returnDataRef)
</span><span class="cx">         *returnDataRef = toAPI(returnData.release().leakRef());
</span><span class="cx"> }
</span><ins>+
+void WKBundlePageAddUserScript(WKBundlePageRef pageRef, WKStringRef source, _WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames)
+{
+    toImpl(pageRef)-&gt;addUserScript(toWTFString(source), toUserContentInjectedFrames(injectedFrames), toUserScriptInjectionTime(injectionTime));
+}
+
+void WKBundlePageAddUserStyleSheet(WKBundlePageRef pageRef, WKStringRef source, WKUserContentInjectedFrames injectedFrames)
+{
+    toImpl(pageRef)-&gt;addUserStyleSheet(toWTFString(source), toUserContentInjectedFrames(injectedFrames));
+}
+
+void WKBundlePageRemoveAllUserContent(WKBundlePageRef pageRef)
+{
+    toImpl(pageRef)-&gt;removeAllUserContent();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> #include &lt;WebKit/WKBase.h&gt;
</span><span class="cx"> #include &lt;WebKit/WKEvent.h&gt;
</span><span class="cx"> #include &lt;WebKit/WKGeometry.h&gt;
</span><ins>+#include &lt;WebKit/WKUserContentInjectedFrames.h&gt;
+#include &lt;WebKit/WKUserScriptInjectionTime.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> extern &quot;C&quot; {
</span><span class="lines">@@ -93,6 +95,11 @@
</span><span class="cx"> WK_EXPORT WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef);
</span><span class="cx"> WK_EXPORT void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef, WKRenderingSuppressionToken);
</span><span class="cx"> 
</span><ins>+// UserContent API (compatible with Modern API, for WKTR)
+WK_EXPORT void WKBundlePageAddUserScript(WKBundlePageRef page, WKStringRef source, _WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames);
+WK_EXPORT void WKBundlePageAddUserStyleSheet(WKBundlePageRef page, WKStringRef source, WKUserContentInjectedFrames injectedFrames);
+WK_EXPORT void WKBundlePageRemoveAllUserContent(WKBundlePageRef page);
+
</ins><span class="cx"> #if TARGET_OS_IPHONE
</span><span class="cx"> WK_EXPORT void WKBundlePageSetUseTestingViewportConfiguration(WKBundlePageRef, bool);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -5006,4 +5006,30 @@
</span><span class="cx">     send(Messages::WebPageProxy::ImageOrMediaDocumentSizeChanged(newSize));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::addUserScript(const String&amp; source, WebCore::UserContentInjectedFrames injectedFrames, WebCore::UserScriptInjectionTime injectionTime)
+{
+    ASSERT(m_userContentController);
+
+    WebCore::UserScript userScript(source, WebCore::blankURL(), Vector&lt;String&gt;(), Vector&lt;String&gt;(), injectionTime, injectedFrames);
+
+    m_userContentController-&gt;userContentController().addUserScript(mainThreadNormalWorld(), std::make_unique&lt;WebCore::UserScript&gt;(userScript));
+}
+
+void WebPage::addUserStyleSheet(const String&amp; source, WebCore::UserContentInjectedFrames injectedFrames)
+{
+    ASSERT(m_userContentController);
+
+    WebCore::UserStyleSheet userStyleSheet(source, WebCore::blankURL(), Vector&lt;String&gt;(), Vector&lt;String&gt;(), injectedFrames, UserStyleUserLevel);
+
+    m_userContentController-&gt;userContentController().addUserStyleSheet(mainThreadNormalWorld(), std::make_unique&lt;WebCore::UserStyleSheet&gt;(userStyleSheet), InjectInExistingDocuments);
+}
+
+void WebPage::removeAllUserContent()
+{
+    if (!m_userContentController)
+        return;
+
+    m_userContentController-&gt;userContentController().removeAllUserContent();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx"> #include &lt;WebCore/TextChecking.h&gt;
</span><span class="cx"> #include &lt;WebCore/TextIndicator.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserActivity.h&gt;
</span><ins>+#include &lt;WebCore/UserContentTypes.h&gt;
+#include &lt;WebCore/UserScriptTypes.h&gt;
</ins><span class="cx"> #include &lt;WebCore/ViewState.h&gt;
</span><span class="cx"> #include &lt;WebCore/ViewportConfiguration.h&gt;
</span><span class="cx"> #include &lt;WebCore/WebCoreKeyboardUIMode.h&gt;
</span><span class="lines">@@ -914,6 +916,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void addUserScript(const String&amp; source, WebCore::UserContentInjectedFrames, WebCore::UserScriptInjectionTime);
+    void addUserStyleSheet(const String&amp; source, WebCore::UserContentInjectedFrames);
+    void removeAllUserContent();
+
</ins><span class="cx"> private:
</span><span class="cx">     WebPage(uint64_t pageID, const WebPageCreationParameters&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/ChangeLog        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -1,3 +1,81 @@
</span><ins>+2015-08-22  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        WebKitTestRunner should use WKWebView on OS X and iOS
+        https://bugs.webkit.org/show_bug.cgi?id=143743
+        &lt;rdar://problem/16947123&gt;
+
+        Reviewed by Anders Carlsson.
+        Patch by Enrica Casucci and myself.
+
+        * WebKitTestRunner/PlatformWebView.h:
+        (WTR::PlatformWebView::windowSnapshotEnabled): Deleted.
+        Add a PlatformWebView constructor that takes a WKWebViewConfiguration
+        instead of WKContext and WKPageGroup.
+
+        Remove the unused, always-true windowSnapshotEnabled().
+        While technically some platforms don't have window snapshotting,
+        they just return null instead of implementing windowSnapshotEnabled().
+
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createOtherPage):
+        (WTR::TestController::initialize):
+        (WTR::TestController::createWebViewWithOptions):
+        Delegate to the various platforms for creating PlatformWebView instances,
+        for creating WKContexts, and for accessing WKPreferences,
+        so that they can do special things (like, use WKWebView instead!).
+
+        (WTR::TestController::resetPreferencesToConsistentValues):
+        Make explicit WebKitTestRunner's desired default for two preferences
+        which have differing defaults between the antique and modern API,
+        for consistency's sake.
+
+        (WTR::TestController::resetStateToConsistentValues):
+        Add platformResetStateToConsistentValues.
+
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::dumpResults):
+        Adjust to the aforementioned removal of windowSnapshotEnabled().
+
+        * WebKitTestRunner/ios/TestControllerCocoa.mm:
+        (WTR::TestController::platformResetStateToConsistentValues):
+        (WTR::TestController::platformPreferences):
+        (WTR::TestController::platformCreateWebView):
+        (WTR::TestController::platformCreateOtherPage):
+        (WTR::TestController::platformInitializeConfiguration):
+        Implement the new platform functions for the Modern WebKit2 API,
+        in a new TestControllerCocoa file that is shared between iOS and Mac.
+        
+        For platformMaybeCreateContext, use the trick that we know we can cast
+        the WKProcessPool to a WKContextRef to retrieve a WKContextRef from
+        WKWebView's configuration.
+
+        Ditto for WKPreferencesRef and WKPreferences.
+
+        Remove user content filters on the WKWebView's userContentController.
+
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        Move code into TestControllerCocoa.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::addUserScript):
+        (WTR::TestRunner::addUserStyleSheet):
+        Adopt WKBundlePage API for user scripts/sheets.
+
+        * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        Make and keep a WKWebView instead of a WKView.
+        
+        * WebKitTestRunner/mac/EventSenderProxy.mm:
+        (WTR::EventSenderProxy::mouseUp):
+        (WTR::EventSenderProxy::mouseMoveTo):
+        Reach inside the WKWebView to the WKView when dispatching events.
+        This is fairly ugly and we should come up with a better solution.
+        Also, fix some flipping and style errors.
+
</ins><span class="cx"> 2015-08-22  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, attempt to fix GTK build after r188718
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx">     WKBundleSetPluginsEnabled(m_bundle, m_pageGroup, true);
</span><span class="cx">     WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false);
</span><span class="cx"> 
</span><del>-    WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
</del><ins>+    WKBundlePageRemoveAllUserContent(page()-&gt;page());
</ins><span class="cx"> 
</span><span class="cx">     m_testRunner-&gt;setShouldDumpFrameLoadCallbacks(booleanForKey(settings, &quot;DumpFrameLoadDelegates&quot;));
</span><span class="cx">     m_testRunner-&gt;setUserStyleSheetEnabled(false);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -172,10 +172,8 @@
</span><span class="cx"> void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
</span><span class="cx"> {
</span><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; sourceWK = toWK(source);
</span><del>-    WKRetainPtr&lt;WKBundleScriptWorldRef&gt; scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
</del><span class="cx"> 
</span><del>-    auto&amp; injectedBundle = InjectedBundle::singleton();
-    WKBundleAddUserScript(injectedBundle.bundle(), injectedBundle.pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0,
</del><ins>+    WKBundlePageAddUserScript(InjectedBundle::singleton().page()-&gt;page(), sourceWK.get(),
</ins><span class="cx">         (runAtStart ? kWKInjectAtDocumentStart : kWKInjectAtDocumentEnd),
</span><span class="cx">         (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
</span><span class="cx"> }
</span><span class="lines">@@ -183,10 +181,8 @@
</span><span class="cx"> void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
</span><span class="cx"> {
</span><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; sourceWK = toWK(source);
</span><del>-    WKRetainPtr&lt;WKBundleScriptWorldRef&gt; scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
</del><span class="cx"> 
</span><del>-    auto&amp; injectedBundle = InjectedBundle::singleton();
-    WKBundleAddUserStyleSheet(injectedBundle.bundle(), injectedBundle.pageGroup(), scriptWorld.get(), sourceWK.get(), 0, 0, 0,
</del><ins>+    WKBundlePageAddUserStyleSheet(InjectedBundle::singleton().page()-&gt;page(), sourceWK.get(),
</ins><span class="cx">         (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerPlatformWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/PlatformWebView.h        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -27,18 +27,22 @@
</span><span class="cx"> #define PlatformWebView_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ViewOptions.h&quot;
</span><ins>+#include &lt;WebKit/WKFoundation.h&gt;
</ins><span class="cx"> #include &lt;WebKit/WKRetainPtr.h&gt;
</span><span class="cx"> 
</span><del>-#if defined(__APPLE__) &amp;&amp; __APPLE__
-#ifdef __OBJC__
-@class WKView;
-@class WebKitTestRunnerWindow;
</del><ins>+#if PLATFORM(COCOA)
+OBJC_CLASS NSView;
+OBJC_CLASS UIView;
+OBJC_CLASS WKWebView;
+OBJC_CLASS WKWebViewConfiguration;
+OBJC_CLASS WebKitTestRunnerWindow;
+
+#if WK_API_ENABLED
+typedef WKWebView *PlatformWKView;
</ins><span class="cx"> #else
</span><del>-class WKView;
-class WebKitTestRunnerWindow;
</del><ins>+typedef NSView *PlatformWKView;
</ins><span class="cx"> #endif
</span><del>-typedef WKView* PlatformWKView;
-typedef WebKitTestRunnerWindow* PlatformWindow;
</del><ins>+typedef WebKitTestRunnerWindow *PlatformWindow;
</ins><span class="cx"> #elif defined(BUILDING_GTK__)
</span><span class="cx"> typedef struct _GtkWidget GtkWidget;
</span><span class="cx"> typedef WKViewRef PlatformWKView;
</span><span class="lines">@@ -52,7 +56,11 @@
</span><span class="cx"> 
</span><span class="cx"> class PlatformWebView {
</span><span class="cx"> public:
</span><ins>+#if PLATFORM(COCOA)
+    PlatformWebView(WKWebViewConfiguration*, const ViewOptions&amp;);
+#else
</ins><span class="cx">     PlatformWebView(WKPageConfigurationRef, const ViewOptions&amp;);
</span><ins>+#endif
</ins><span class="cx">     ~PlatformWebView();
</span><span class="cx"> 
</span><span class="cx">     WKPageRef page();
</span><span class="lines">@@ -61,9 +69,6 @@
</span><span class="cx">     void resizeTo(unsigned width, unsigned height);
</span><span class="cx">     void focus();
</span><span class="cx"> 
</span><del>-    // Window snapshot is always enabled by default on all other platform.
-    static bool windowSnapshotEnabled() { return true; }
-
</del><span class="cx">     WKRect windowFrame();
</span><span class="cx">     void setWindowFrame(WKRect);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -197,11 +197,11 @@
</span><span class="cx">     TestController::singleton().handleUserMediaPermissionRequest(permissionRequest);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WKPageRef TestController::createOtherPage(WKPageRef oldPpage, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)
</del><ins>+WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo)
</ins><span class="cx"> {
</span><span class="cx">     PlatformWebView* parentView = static_cast&lt;PlatformWebView*&gt;(const_cast&lt;void*&gt;(clientInfo));
</span><span class="cx"> 
</span><del>-    PlatformWebView* view = new PlatformWebView(configuration, parentView-&gt;options());
</del><ins>+    PlatformWebView* view = platformCreateOtherPage(parentView, configuration, parentView-&gt;options());
</ins><span class="cx">     WKPageRef newPage = view-&gt;page();
</span><span class="cx"> 
</span><span class="cx">     view-&gt;resizeTo(800, 600);
</span><span class="lines">@@ -310,7 +310,6 @@
</span><span class="cx">     return platformLibraryPathForTesting();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> void TestController::initialize(int argc, const char* argv[])
</span><span class="cx"> {
</span><span class="cx">     platformInitialize();
</span><span class="lines">@@ -372,8 +371,8 @@
</span><span class="cx">         WKContextConfigurationSetWebSQLDatabaseDirectory(configuration.get(), toWK(temporaryFolder + separator + &quot;Databases&quot; + separator + &quot;WebSQL&quot;).get());
</span><span class="cx">         WKContextConfigurationSetMediaKeysStorageDirectory(configuration.get(), toWK(temporaryFolder + separator + &quot;MediaKeys&quot;).get());
</span><span class="cx">     }
</span><ins>+    m_context = platformAdjustContext(adoptWK(WKContextCreateWithConfiguration(configuration.get())).get(), configuration.get());
</ins><span class="cx"> 
</span><del>-    m_context = adoptWK(WKContextCreateWithConfiguration(configuration.get()));
</del><span class="cx">     m_geolocationProvider = std::make_unique&lt;GeolocationProviderMock&gt;(m_context.get());
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(EFL)
</span><span class="lines">@@ -435,6 +434,7 @@
</span><span class="cx">     m_configuration = adoptWK(WKPageConfigurationCreate());
</span><span class="cx">     WKPageConfigurationSetContext(m_configuration.get(), m_context.get());
</span><span class="cx">     WKPageConfigurationSetPageGroup(m_configuration.get(), m_pageGroup.get());
</span><ins>+    WKPageConfigurationSetUserContentController(m_configuration.get(), adoptWK(WKUserContentControllerCreate()).get());
</ins><span class="cx"> 
</span><span class="cx">     // Some preferences (notably mock scroll bars setting) currently cannot be re-applied to an existing view, so we need to set them now.
</span><span class="cx">     resetPreferencesToConsistentValues();
</span><span class="lines">@@ -442,7 +442,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::createWebViewWithOptions(const ViewOptions&amp; options)
</span><span class="cx"> {
</span><del>-    m_mainWebView = std::make_unique&lt;PlatformWebView&gt;(m_configuration.get(), options);
</del><ins>+    platformCreateWebView(m_configuration.get(), options);
</ins><span class="cx">     WKPageUIClientV6 pageUIClient = {
</span><span class="cx">         { 6, m_mainWebView.get() },
</span><span class="cx">         0, // createNewPage_deprecatedForUseWithV0
</span><span class="lines">@@ -568,7 +568,7 @@
</span><span class="cx"> void TestController::resetPreferencesToConsistentValues()
</span><span class="cx"> {
</span><span class="cx">     // Reset preferences
</span><del>-    WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
</del><ins>+    WKPreferencesRef preferences = platformPreferences();
</ins><span class="cx">     WKPreferencesResetTestRunnerOverrides(preferences);
</span><span class="cx">     WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled(preferences, false);
</span><span class="cx">     WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
</span><span class="lines">@@ -622,6 +622,8 @@
</span><span class="cx">     WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(preferences, false);
</span><span class="cx"> 
</span><span class="cx">     WKPreferencesSetAcceleratedDrawingEnabled(preferences, m_shouldUseAcceleratedDrawing);
</span><ins>+    // FIXME: We should be testing the default.
+    WKPreferencesSetStorageBlockingPolicy(preferences, kWKAllowAllStorage);
</ins><span class="cx"> 
</span><span class="cx">     WKCookieManagerDeleteAllCookies(WKContextGetCookieManager(m_context.get()));
</span><span class="cx"> 
</span><span class="lines">@@ -634,6 +636,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_beforeUnloadReturnValue = true;
</span><span class="cx"> 
</span><ins>+    // This setting differs between the antique and modern Mac WebKit2 API.
+    // For now, maintain the antique behavior, because some tests depend on it!
+    // FIXME: We should be testing the default.
+    WKPageSetBackgroundExtendsBeyondPage(m_mainWebView-&gt;page(), false);
+
</ins><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; messageName = adoptWK(WKStringCreateWithUTF8CString(&quot;Reset&quot;));
</span><span class="cx">     WKRetainPtr&lt;WKMutableDictionaryRef&gt; resetMessageBody = adoptWK(WKMutableDictionaryCreate());
</span><span class="cx"> 
</span><span class="lines">@@ -668,7 +675,7 @@
</span><span class="cx">     WKTextCheckerContinuousSpellCheckingEnabledStateChanged(true);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // in the case that a test using the chrome input field failed, be sure to clean up for the next test
</del><ins>+    // In the case that a test using the chrome input field failed, be sure to clean up for the next test.
</ins><span class="cx">     m_mainWebView-&gt;removeChromeInputField();
</span><span class="cx">     m_mainWebView-&gt;focus();
</span><span class="cx"> 
</span><span class="lines">@@ -710,10 +717,10 @@
</span><span class="cx"> 
</span><span class="cx">     m_shouldLogHistoryClientCallbacks = false;
</span><span class="cx"> 
</span><del>-    WKPageGroupRemoveAllUserContentFilters(WKPageGetPageGroup(m_mainWebView-&gt;page()));
-
</del><span class="cx">     setHidden(false);
</span><span class="cx"> 
</span><ins>+    platformResetStateToConsistentValues();
+
</ins><span class="cx">     // Reset main page back to about:blank
</span><span class="cx">     m_doneResetting = false;
</span><span class="cx"> 
</span><span class="lines">@@ -1593,4 +1600,36 @@
</span><span class="cx">     m_currentInvocation-&gt;outputText(String::format(&quot;WebView updated the title for history URL \&quot;%s\&quot; to \&quot;%s\&quot;.\n&quot;, toSTD(urlStringWK).c_str(), toSTD(title).c_str()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(COCOA)
+void TestController::platformWillRunTest(const TestInvocation&amp;)
+{
+}
+
+WKPreferencesRef TestController::platformPreferences()
+{
+    WKRetainPtr&lt;WKPageConfigurationRef&gt; configuration = adoptWK(WKPageCopyPageConfiguration(m_mainWebView-&gt;page())); 
+    return WKPageConfigurationGetPreferences(configuration.get());
+}
+
+void TestController::platformCreateWebView(WKPageConfigurationRef configuration, const ViewOptions&amp; options)
+{
+    m_mainWebView = std::make_unique&lt;PlatformWebView&gt;(configuration, options);
+}
+
+PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef configuration, const ViewOptions&amp; options)
+{
+    return new PlatformWebView(configuration, options);
+}
+
+WKContextRef TestController::platformAdjustContext(WKContextRef context, WKContextConfigurationRef contextConfiguration)
+{
+    return context;
+}
+
+void TestController::platformResetStateToConsistentValues()
+{
+
+}
+#endif
+
</ins><span class="cx"> } // namespace WTR
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx"> #include &lt;vector&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+OBJC_CLASS WKWebViewConfiguration;
+
</ins><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><span class="cx"> class TestInvocation;
</span><span class="lines">@@ -132,12 +134,17 @@
</span><span class="cx"> 
</span><span class="cx">     void platformInitialize();
</span><span class="cx">     void platformDestroy();
</span><ins>+    WKContextRef platformAdjustContext(WKContextRef, WKContextConfigurationRef);
</ins><span class="cx">     void platformInitializeContext();
</span><ins>+    void platformCreateWebView(WKPageConfigurationRef, const ViewOptions&amp;);
+    static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions&amp;);
</ins><span class="cx">     void platformResetPreferencesToConsistentValues();
</span><ins>+    void platformResetStateToConsistentValues();
</ins><span class="cx">     void platformConfigureViewForTest(const TestInvocation&amp;);
</span><span class="cx">     void platformWillRunTest(const TestInvocation&amp;);
</span><span class="cx">     void platformRunUntil(bool&amp; done, double timeout);
</span><span class="cx">     void platformDidCommitLoadForFrame(WKPageRef, WKFrameRef);
</span><ins>+    WKPreferencesRef platformPreferences();
</ins><span class="cx">     void initializeInjectedBundlePath();
</span><span class="cx">     void initializeTestPluginDirectory();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -268,15 +268,13 @@
</span><span class="cx">         dumpAudio(m_audioResult.get());
</span><span class="cx"> 
</span><span class="cx">     if (m_dumpPixels &amp;&amp; m_pixelResult) {
</span><del>-        if (PlatformWebView::windowSnapshotEnabled()) {
-            m_gotRepaint = false;
-            WKPageForceRepaint(TestController::singleton().mainWebView()-&gt;page(), this, TestInvocation::forceRepaintDoneCallback);
-            TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
-            if (!m_gotRepaint) {
-                m_errorMessage = &quot;Timed out waiting for pre-pixel dump repaint\n&quot;;
-                m_webProcessIsUnresponsive = true;
-                return;
-            }
</del><ins>+        m_gotRepaint = false;
+        WKPageForceRepaint(TestController::singleton().mainWebView()-&gt;page(), this, TestInvocation::forceRepaintDoneCallback);
+        TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
+        if (!m_gotRepaint) {
+            m_errorMessage = &quot;Timed out waiting for pre-pixel dump repaint\n&quot;;
+            m_webProcessIsUnresponsive = true;
+            return;
</ins><span class="cx">         }
</span><span class="cx">         dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -40,6 +40,8 @@
</span><span class="cx">                 29A8FCDD145F0337009045A6 /* JSAccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */; };
</span><span class="cx">                 29A8FCE2145F037B009045A6 /* AccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */; };
</span><span class="cx">                 29A8FCE5145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */; };
</span><ins>+                2DCE2CD31B8452F800C7F832 /* TestControllerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */; };
+                2DCE2CD41B84530A00C7F832 /* TestControllerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */; };
</ins><span class="cx">                 2E34C90018B68808000067BB /* WebKitTestRunnerInjectedBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */; };
</span><span class="cx">                 2E63ED8A1891AD7E002A7AFC /* AccessibilityControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */; };
</span><span class="cx">                 2E63ED8B1891AD7E002A7AFC /* AccessibilityTextMarkerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED771891ACE9002A7AFC /* AccessibilityTextMarkerIOS.mm */; };
</span><span class="lines">@@ -171,6 +173,7 @@
</span><span class="cx">                 29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityTextMarkerRange.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">                 29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarkerRange.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.h; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">                 29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTextMarkerRangeMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestControllerCocoa.mm; path = cocoa/TestControllerCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityControllerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E63ED761891ACE9002A7AFC /* AccessibilityNotificationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityNotificationHandler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E63ED771891ACE9002A7AFC /* AccessibilityTextMarkerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTextMarkerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -397,6 +400,7 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 0FEB90A21905BC6A000FDBF3 /* CrashReporterInfo.h */,
</span><span class="cx">                                 0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */,
</span><ins>+                                2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -786,6 +790,7 @@
</span><span class="cx">                                 2E63ED971891ADC7002A7AFC /* PixelDumpSupport.cpp in Sources */,
</span><span class="cx">                                 2E63ED981891ADC7002A7AFC /* TestController.cpp in Sources */,
</span><span class="cx">                                 2E63ED921891ADAD002A7AFC /* TestControllerIOS.mm in Sources */,
</span><ins>+                                2DCE2CD31B8452F800C7F832 /* TestControllerCocoa.mm in Sources */,
</ins><span class="cx">                                 0FEB90A81905C537000FDBF3 /* CrashReporterInfo.mm in Sources */,
</span><span class="cx">                                 2E63ED991891ADC7002A7AFC /* TestInvocation.cpp in Sources */,
</span><span class="cx">                                 2E63EDA51891BD8E002A7AFC /* TestInvocationCG.cpp in Sources */,
</span><span class="lines">@@ -805,6 +810,7 @@
</span><span class="cx">                                 E1C642C317CBCC7300D66A3C /* PoseAsClass.mm in Sources */,
</span><span class="cx">                                 E132AA3D17CE776F00611DF0 /* WebKitTestRunnerEvent.mm in Sources */,
</span><span class="cx">                                 5670B8281386FCA5002EB355 /* EventSenderProxy.mm in Sources */,
</span><ins>+                                2DCE2CD41B84530A00C7F832 /* TestControllerCocoa.mm in Sources */,
</ins><span class="cx">                                 26D758E7160BECDD00268472 /* GeolocationProviderMock.cpp in Sources */,
</span><span class="cx">                                 BC793400118F7C84005EA8E2 /* main.mm in Sources */,
</span><span class="cx">                                 5322FB4613FDA0EA0041ABCC /* PixelDumpSupport.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnercocoaTestControllerCocoamm"></a>
<div class="addfile"><h4>Added: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (0 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm                                (rev 0)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;TestController.h&quot;
+
+#import &quot;CrashReporterInfo.h&quot;
+#import &quot;PlatformWebView.h&quot;
+#import &quot;TestInvocation.h&quot;
+#import &lt;Foundation/Foundation.h&gt;
+#import &lt;WebKit/WKContextConfigurationRef.h&gt;
+#import &lt;WebKit/WKPreferencesRefPrivate.h&gt;
+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
+#import &lt;WebKit/WKStringCF.h&gt;
+#import &lt;WebKit/WKUserContentControllerPrivate.h&gt;
+#import &lt;WebKit/WKWebView.h&gt;
+#import &lt;WebKit/WKWebViewConfiguration.h&gt;
+#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
+#import &lt;WebKit/_WKProcessPoolConfiguration.h&gt;
+#import &lt;WebKit/_WKUserContentExtensionStore.h&gt;
+#import &lt;WebKit/_WKUserContentExtensionStorePrivate.h&gt;
+#import &lt;wtf/MainThread.h&gt;
+
+namespace WTR {
+
+static WKWebViewConfiguration *globalWebViewConfiguration;
+
+void initializeWebViewConfiguration(const char* libraryPath, WKStringRef injectedBundlePath, WKContextRef context, WKContextConfigurationRef contextConfiguration)
+{
+#if WK_API_ENABLED
+    ASSERT(!globalWebViewConfiguration);
+    globalWebViewConfiguration = [[WKWebViewConfiguration alloc] init];
+
+    globalWebViewConfiguration.processPool = [[WKProcessPool alloc] _initWithConfiguration:(_WKProcessPoolConfiguration *)contextConfiguration];
+    globalWebViewConfiguration.websiteDataStore = (WKWebsiteDataStore *)WKContextGetWebsiteDataStore(context);
+#endif
+}
+
+WKPreferencesRef TestController::platformPreferences()
+{
+#if WK_API_ENABLED
+    return (WKPreferencesRef)globalWebViewConfiguration.preferences;
+#else
+    return nullptr;
+#endif
+}
+
+void TestController::platformCreateWebView(WKPageConfigurationRef, const ViewOptions&amp; options)
+{
+    m_mainWebView = std::make_unique&lt;PlatformWebView&gt;(globalWebViewConfiguration, options);
+}
+
+PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions&amp; options)
+{
+#if WK_API_ENABLED
+    WKWebViewConfiguration *newConfiguration = [[globalWebViewConfiguration copy] autorelease];
+    newConfiguration._relatedWebView = static_cast&lt;WKWebView*&gt;(parentView-&gt;platformView());
+    return new PlatformWebView(newConfiguration, options);
+#else
+    return nullptr;
+#endif
+}
+
+WKContextRef TestController::platformAdjustContext(WKContextRef context, WKContextConfigurationRef contextConfiguration)
+{
+#if WK_API_ENABLED
+    initializeWebViewConfiguration(libraryPathForTesting(), injectedBundlePath(), context, contextConfiguration);
+    return (WKContextRef)globalWebViewConfiguration.processPool;
+#else
+    return nullptr;
+#endif
+}
+
+void TestController::platformRunUntil(bool&amp; done, double timeout)
+{
+    NSDate *endDate = (timeout &gt; 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture];
+
+    while (!done &amp;&amp; [endDate compare:[NSDate date]] == NSOrderedDescending)
+        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate];
+}
+
+void TestController::platformResetStateToConsistentValues()
+{
+#if WK_API_ENABLED
+    __block bool doneRemoving = false;
+    [[_WKUserContentExtensionStore defaultStore] removeContentExtensionForIdentifier:@&quot;TestContentExtensions&quot; completionHandler:^(NSError *error) {
+        doneRemoving = true;
+    }];
+    platformRunUntil(doneRemoving, 0);
+    [[_WKUserContentExtensionStore defaultStore] _removeAllContentExtensions];
+
+    if (PlatformWebView* webView = mainWebView())
+        [webView-&gt;platformView().configuration.userContentController _removeAllUserContentFilters];
+#endif
+}
+
+void TestController::platformWillRunTest(const TestInvocation&amp; testInvocation)
+{
+    setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
+}
+
+} // namespace WTR
</ins></span></pre></div>
<a id="trunkToolsWebKitTestRunnereflTestControllerEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -64,10 +64,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::platformWillRunTest(const TestInvocation&amp;)
-{
-}
-
</del><span class="cx"> void TestController::platformRunUntil(bool&amp; condition, double timeout)
</span><span class="cx"> {
</span><span class="cx">     if (timeout &lt;= 0) {
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnergtkTestControllerGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -52,10 +52,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::platformWillRunTest(const TestInvocation&amp;)
-{
-}
-
</del><span class="cx"> void TestController::platformRunUntil(bool&amp;, double timeout)
</span><span class="cx"> {
</span><span class="cx">     if (timeout &gt; 0) {
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosPlatformWebViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -28,10 +28,15 @@
</span><span class="cx"> #include &quot;TestController.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &lt;WebKit/WKImageCG.h&gt;
</span><del>-#import &lt;WebKit/WKViewPrivate.h&gt;
</del><span class="cx"> #import &lt;WebKit/WKPreferencesPrivate.h&gt;
</span><ins>+#import &lt;WebKit/WKWebViewConfiguration.h&gt;
+#import &lt;WebKit/WKWebViewPrivate.h&gt;
</ins><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><ins>+@interface WKWebView (Details)
+- (WKPageRef)_pageForTesting;
+@end
+
</ins><span class="cx"> @interface WebKitTestRunnerWindow : UIWindow {
</span><span class="cx">     WTR::PlatformWebView* _platformWebView;
</span><span class="cx">     CGPoint _fakeOrigin;
</span><span class="lines">@@ -40,33 +45,6 @@
</span><span class="cx"> @property (nonatomic, assign) WTR::PlatformWebView* platformWebView;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface TestRunnerWKView : WKView {
-    BOOL _useTiledDrawing;
-}
-
-@property (nonatomic, assign) BOOL useTiledDrawing;
-@end
-
-@implementation TestRunnerWKView
-
-@synthesize useTiledDrawing = _useTiledDrawing;
-
-- (id)initWithFrame:(CGRect)frame configurationRef:(WKPageConfigurationRef)configuration useTiledDrawing:(BOOL)useTiledDrawing
-{
-    if (!(self = [super initWithFrame:frame configurationRef:configuration]))
-        return nil;
-
-    _useTiledDrawing = useTiledDrawing;
-    return self;
-}
-
-- (BOOL)_shouldUseTiledDrawingArea
-{
-    return _useTiledDrawing;
-}
-
-@end
-
</del><span class="cx"> @implementation WebKitTestRunnerWindow
</span><span class="cx"> @synthesize platformWebView = _platformWebView;
</span><span class="cx"> 
</span><span class="lines">@@ -122,18 +100,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><del>-PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions&amp; options)
</del><ins>+PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions&amp; options)
</ins><span class="cx">     : m_windowIsKey(true)
</span><span class="cx">     , m_options(options)
</span><span class="cx"> {
</span><span class="cx">     CGRect rect = CGRectMake(0, 0, TestController::viewWidth, TestController::viewHeight);
</span><del>-    m_view = [[TestRunnerWKView alloc] initWithFrame:rect configurationRef:configuration useTiledDrawing:m_options.useTiledDrawing];
</del><ins>+    m_view = [[WKWebView alloc] initWithFrame:rect configuration:configuration];
</ins><span class="cx"> 
</span><del>-    WKPageGroupRef pageGroupRef = WKPageConfigurationGetPageGroup(configuration);
-
-    WKPreferencesSetCompositingBordersVisible(WKPageGroupGetPreferences(pageGroupRef), YES);
-    WKPreferencesSetCompositingRepaintCountersVisible(WKPageGroupGetPreferences(pageGroupRef), YES);
-
</del><span class="cx">     CGRect windowRect = rect;
</span><span class="cx">     m_window = [[WebKitTestRunnerWindow alloc] initWithFrame:windowRect];
</span><span class="cx">     m_window.platformWebView = this;
</span><span class="lines">@@ -153,19 +126,18 @@
</span><span class="cx"> PlatformWebView::~PlatformWebView()
</span><span class="cx"> {
</span><span class="cx">     m_window.platformWebView = 0;
</span><del>-//    [m_window close];
</del><span class="cx">     [m_view release];
</span><span class="cx">     [m_window release];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WKPageRef PlatformWebView::page()
</span><span class="cx"> {
</span><del>-    return [m_view pageRef];
</del><ins>+    return [m_view _pageForTesting];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::focus()
</span><span class="cx"> {
</span><del>-//    [m_window makeFirstResponder:m_view]; // FIXME: iOS equivalent?
</del><ins>+    makeWebViewFirstResponder();
</ins><span class="cx">     setWindowIsKey(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -184,7 +156,7 @@
</span><span class="cx"> void PlatformWebView::setWindowFrame(WKRect frame)
</span><span class="cx"> {
</span><span class="cx">     [m_window setFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)];
</span><del>-    [m_view setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
</del><ins>+    [platformView() setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::didInitializeClients()
</span><span class="lines">@@ -215,7 +187,8 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::makeWebViewFirstResponder()
</span><span class="cx"> {
</span><del>-//    [m_window makeFirstResponder:m_view];
</del><ins>+    // FIXME: iOS equivalent?
+    // [m_window makeFirstResponder:m_view];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::changeWindowScaleIfNeeded(float)
</span><span class="lines">@@ -225,14 +198,12 @@
</span><span class="cx"> 
</span><span class="cx"> WKRetainPtr&lt;WKImageRef&gt; PlatformWebView::windowSnapshotImage()
</span><span class="cx"> {
</span><del>-    return 0; // FIXME for iOS?
</del><ins>+    // FIXME: Need an implementation of this, or we're depending on software paints!
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PlatformWebView::viewSupportsOptions(const ViewOptions&amp; options) const
</span><span class="cx"> {
</span><del>-    if (m_options.useTiledDrawing != options.useTiledDrawing)
-        return false;
-
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosTestControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -26,12 +26,16 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;TestController.h&quot;
</span><span class="cx"> 
</span><del>-#import &quot;CrashReporterInfo.h&quot;
-#import &lt;Foundation/Foundation.h&gt;
</del><span class="cx"> #import &quot;PlatformWebView.h&quot;
</span><span class="cx"> #import &quot;TestInvocation.h&quot;
</span><ins>+#import &lt;Foundation/Foundation.h&gt;
</ins><span class="cx"> #import &lt;WebKit/WKPreferencesRefPrivate.h&gt;
</span><ins>+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKit/WKStringCF.h&gt;
</span><ins>+#import &lt;WebKit/WKUserContentControllerPrivate.h&gt;
+#import &lt;WebKit/WKWebView.h&gt;
+#import &lt;WebKit/WKWebViewConfiguration.h&gt;
+#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
</ins><span class="cx"> #import &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="lines">@@ -70,11 +74,6 @@
</span><span class="cx">     m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::platformWillRunTest(const TestInvocation&amp; testInvocation)
-{
-    setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
-}
-
</del><span class="cx"> static bool shouldMakeViewportFlexible(const TestInvocation&amp; test)
</span><span class="cx"> {
</span><span class="cx">     return test.urlContains(&quot;viewport/&quot;);
</span><span class="lines">@@ -82,7 +81,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::platformResetPreferencesToConsistentValues()
</span><span class="cx"> {
</span><del>-    WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
</del><ins>+    WKPreferencesRef preferences = platformPreferences();
</ins><span class="cx">     // Note that WKPreferencesSetTextAutosizingEnabled has no effect on iOS.
</span><span class="cx">     WKPreferencesSetMinimumZoomFontSize(preferences, 0);
</span><span class="cx"> }
</span><span class="lines">@@ -102,14 +101,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::platformRunUntil(bool&amp; done, double timeout)
-{
-    NSDate *endDate = (timeout &gt; 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture];
-
-    while (!done &amp;&amp; [endDate compare:[NSDate date]] == NSOrderedDescending)
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate];
-}
-
</del><span class="cx"> void TestController::platformInitializeContext()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacEventSenderProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import &lt;Carbon/Carbon.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKString.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKPagePrivate.h&gt;
</span><ins>+#import &lt;WebKit/WKWebView.h&gt;
</ins><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @interface NSApplication (Details)
</span><span class="lines">@@ -268,7 +269,17 @@
</span><span class="cx">     // FIXME: Silly hack to teach WKTR to respect capturing mouse events outside the WKView.
</span><span class="cx">     // The right solution is just to use NSApplication's built-in event sending methods, 
</span><span class="cx">     // instead of rolling our own algorithm for selecting an event target.
</span><del>-    targetView = targetView ? targetView : m_testController-&gt;mainWebView()-&gt;platformView();
</del><ins>+    // FIXME: This is even worse now, because we need to hit the WKWebView's inner WKView
+    // when using the modern API, so the level of fakery and horror increases.
+    if (!targetView) {
+        targetView = m_testController-&gt;mainWebView()-&gt;platformView();
+        for (NSView *wkWebViewChild in targetView.subviews) {
+            if ([wkWebViewChild isKindOfClass:[WKView class]]) {
+                targetView = wkWebViewChild;
+                break;
+            }
+        }
+    }
</ins><span class="cx">     ASSERT(targetView);
</span><span class="cx">     [NSApp _setCurrentEvent:event];
</span><span class="cx">     [targetView mouseUp:event];
</span><span class="lines">@@ -401,28 +412,27 @@
</span><span class="cx"> void EventSenderProxy::mouseMoveTo(double x, double y)
</span><span class="cx"> {
</span><span class="cx">     NSView *view = m_testController-&gt;mainWebView()-&gt;platformView();
</span><del>-    NSPoint position = [view convertPoint:NSMakePoint(x, y) toView:nil];
</del><ins>+    NSPoint position = [view convertPoint:NSMakePoint(x, view.frame.size.height - y) toView:nil];
</ins><span class="cx">     m_position.x = position.x;
</span><span class="cx">     m_position.y = position.y;
</span><span class="cx">     NSEvent *event = [NSEvent mouseEventWithType:(m_leftMouseButtonDown ? NSLeftMouseDragged : NSMouseMoved)
</span><span class="cx">                                         location:position
</span><span class="cx">                                    modifierFlags:0 
</span><span class="cx">                                        timestamp:absoluteTimeForEventTime(currentEventTime())
</span><del>-                                    windowNumber:[[view window] windowNumber] 
</del><ins>+                                    windowNumber:view.window.windowNumber
</ins><span class="cx">                                          context:[NSGraphicsContext currentContext] 
</span><span class="cx">                                      eventNumber:++eventNumber 
</span><span class="cx">                                       clickCount:(m_leftMouseButtonDown ? m_clickCount : 0) 
</span><del>-                                        pressure:0.0];
</del><ins>+                                        pressure:0];
</ins><span class="cx"> 
</span><del>-    NSView *targetView = [m_testController-&gt;mainWebView()-&gt;platformView() hitTest:[event locationInWindow]];
</del><ins>+    NSPoint windowLocation = event.locationInWindow;
+    NSView *targetView = [m_testController-&gt;mainWebView()-&gt;platformView() hitTest:windowLocation];
</ins><span class="cx">     if (targetView) {
</span><span class="cx">         [NSApp _setCurrentEvent:event];
</span><span class="cx">         [targetView mouseMoved:event];
</span><span class="cx">         [NSApp _setCurrentEvent:nil];
</span><del>-    } else {
-        NSPoint windowLocation = [event locationInWindow];
</del><ins>+    } else
</ins><span class="cx">         WTFLogAlways(&quot;mouseMoveTo failed to find a target view at %f,%f\n&quot;, windowLocation.x, windowLocation.y);
</span><del>-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventSenderProxy::leapForward(int milliseconds)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacPlatformWebViewMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -30,9 +30,16 @@
</span><span class="cx"> #import &quot;WebKitTestRunnerDraggingInfo.h&quot;
</span><span class="cx"> #import &lt;WebKit/WKImageCG.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKPreferencesPrivate.h&gt;
</span><del>-#import &lt;WebKit/WKViewPrivate.h&gt;
</del><ins>+#import &lt;WebKit/WKWebViewConfiguration.h&gt;
+#import &lt;WebKit/WKWebViewPrivate.h&gt;
</ins><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><ins>+#if WK_API_ENABLED
+@interface WKWebView (Details)
+- (WKPageRef)_pageForTesting;
+@end
+#endif
+
</ins><span class="cx"> using namespace WTR;
</span><span class="cx"> 
</span><span class="cx"> enum {
</span><span class="lines">@@ -46,26 +53,12 @@
</span><span class="cx"> @property (nonatomic, assign) PlatformWebView* platformWebView;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface TestRunnerWKView : WKView {
-    BOOL _useThreadedScrolling;
-}
-
-@property (nonatomic, assign) BOOL useThreadedScrolling;
</del><ins>+#if WK_API_ENABLED
+@interface TestRunnerWKWebView : WKWebView
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@implementation TestRunnerWKView
</del><ins>+@implementation TestRunnerWKWebView
</ins><span class="cx"> 
</span><del>-@synthesize useThreadedScrolling = _useThreadedScrolling;
-
-- (id)initWithFrame:(NSRect)frame configurationRef:(WKPageConfigurationRef)configuration useThreadedScrolling:(BOOL)useThreadedScrolling
-{
-    if (!(self = [super initWithFrame:frame configurationRef:configuration]))
-        return nil;
-
-    _useThreadedScrolling = useThreadedScrolling;
-    return self;
-}
-
</del><span class="cx"> - (void)dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag
</span><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;WebKitTestRunnerDraggingInfo&gt; draggingInfo = adoptNS([[WebKitTestRunnerDraggingInfo alloc] initWithImage:anImage offset:initialOffset pasteboard:pboard source:sourceObj]);
</span><span class="lines">@@ -73,6 +66,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> @implementation WebKitTestRunnerWindow
</span><span class="cx"> @synthesize platformWebView = _platformWebView;
</span><span class="lines">@@ -120,23 +114,21 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><del>-PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions&amp; options)
</del><ins>+PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions&amp; options)
</ins><span class="cx">     : m_windowIsKey(true)
</span><span class="cx">     , m_options(options)
</span><span class="cx"> {
</span><del>-    WKPageGroupRef pageGroupRef = WKPageConfigurationGetPageGroup(configuration);
-
-    // The tiled drawing specific tests also depend on threaded scrolling.
-    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroupRef);
-    WKPreferencesSetThreadedScrollingEnabled(preferences, m_options.useThreadedScrolling);
-
</del><ins>+#if WK_API_ENABLED
</ins><span class="cx">     // FIXME: Not sure this is the best place for this; maybe we should have API to set this so we can do it from TestController?
</span><span class="cx">     if (m_options.useRemoteLayerTree)
</span><span class="cx">         [[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@&quot;WebKit2UseRemoteLayerTreeDrawingArea&quot;];
</span><span class="cx"> 
</span><ins>+    RetainPtr&lt;WKWebViewConfiguration&gt; copiedConfiguration = adoptNS([configuration copy]);
+    WKPreferencesSetThreadedScrollingEnabled((WKPreferencesRef)[copiedConfiguration preferences], m_options.useThreadedScrolling);
+
</ins><span class="cx">     NSRect rect = NSMakeRect(0, 0, TestController::viewWidth, TestController::viewHeight);
</span><del>-    m_view = [[TestRunnerWKView alloc] initWithFrame:rect configurationRef:configuration useThreadedScrolling:options.useThreadedScrolling];
-    [m_view setWindowOcclusionDetectionEnabled:NO];
</del><ins>+    m_view = [[TestRunnerWKWebView alloc] initWithFrame:rect configuration:copiedConfiguration.get()];
+    [m_view _setWindowOcclusionDetectionEnabled:NO];
</ins><span class="cx"> 
</span><span class="cx">     NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0];
</span><span class="cx">     NSRect windowRect = m_options.shouldShowWebView ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
</span><span class="lines">@@ -150,6 +142,7 @@
</span><span class="cx">     else
</span><span class="cx">         [m_window orderBack:nil];
</span><span class="cx">     [m_window setReleasedWhenClosed:NO];
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::resizeTo(unsigned width, unsigned height)
</span><span class="lines">@@ -170,12 +163,16 @@
</span><span class="cx"> 
</span><span class="cx"> WKPageRef PlatformWebView::page()
</span><span class="cx"> {
</span><del>-    return [m_view pageRef];
</del><ins>+#if WK_API_ENABLED
+    return [m_view _pageForTesting];
+#else
+    return nullptr;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::focus()
</span><span class="cx"> {
</span><del>-    [m_window makeFirstResponder:m_view];
</del><ins>+    [m_window makeFirstResponder:platformView()];
</ins><span class="cx">     setWindowIsKey(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -194,7 +191,7 @@
</span><span class="cx"> void PlatformWebView::setWindowFrame(WKRect frame)
</span><span class="cx"> {
</span><span class="cx">     [m_window setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height) display:YES];
</span><del>-    [m_view setFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)];
</del><ins>+    [platformView() setFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::didInitializeClients()
</span><span class="lines">@@ -205,18 +202,19 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::addChromeInputField()
</span><span class="cx"> {
</span><del>-    NSTextField* textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
</del><ins>+    NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
</ins><span class="cx">     textField.tag = 1;
</span><span class="cx">     [[m_window contentView] addSubview:textField];
</span><span class="cx">     [textField release];
</span><span class="cx"> 
</span><del>-    [textField setNextKeyView:m_view];
-    [m_view setNextKeyView:textField];
</del><ins>+    NSView *view = platformView();
+    [textField setNextKeyView:view];
+    [view setNextKeyView:textField];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::removeChromeInputField()
</span><span class="cx"> {
</span><del>-    NSView* textField = [[m_window contentView] viewWithTag:1];
</del><ins>+    NSView *textField = [[m_window contentView] viewWithTag:1];
</ins><span class="cx">     if (textField) {
</span><span class="cx">         [textField removeFromSuperview];
</span><span class="cx">         makeWebViewFirstResponder();
</span><span class="lines">@@ -225,12 +223,12 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::makeWebViewFirstResponder()
</span><span class="cx"> {
</span><del>-    [m_window makeFirstResponder:m_view];
</del><ins>+    [m_window makeFirstResponder:platformView()];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WKRetainPtr&lt;WKImageRef&gt; PlatformWebView::windowSnapshotImage()
</span><span class="cx"> {
</span><del>-    [m_view display];
</del><ins>+    [platformView() display];
</ins><span class="cx">     CGWindowImageOption options = kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque;
</span><span class="cx"> 
</span><span class="cx">     if ([m_window backingScaleFactor] == 1)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacTestControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (188827 => 188828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2015-08-22 19:29:44 UTC (rev 188827)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2015-08-22 22:20:46 UTC (rev 188828)
</span><span class="lines">@@ -26,15 +26,19 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;TestController.h&quot;
</span><span class="cx"> 
</span><del>-#import &quot;CrashReporterInfo.h&quot;
</del><span class="cx"> #import &quot;PlatformWebView.h&quot;
</span><span class="cx"> #import &quot;PoseAsClass.h&quot;
</span><span class="cx"> #import &quot;TestInvocation.h&quot;
</span><span class="cx"> #import &quot;WebKitTestRunnerPasteboard.h&quot;
</span><span class="cx"> #import &lt;WebKit/WKContextPrivate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKPageGroup.h&gt;
</span><ins>+#import &lt;WebKit/WKProcessPoolPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKit/WKStringCF.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKURLCF.h&gt;
</span><ins>+#import &lt;WebKit/WKUserContentControllerPrivate.h&gt;
+#import &lt;WebKit/WKWebView.h&gt;
+#import &lt;WebKit/WKWebViewConfiguration.h&gt;
+#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKit/_WKUserContentExtensionStore.h&gt;
</span><span class="cx"> #import &lt;WebKit/_WKUserContentExtensionStorePrivate.h&gt;
</span><span class="cx"> #import &lt;mach-o/dyld.h&gt;
</span><span class="lines">@@ -73,11 +77,6 @@
</span><span class="cx">     m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::platformWillRunTest(const TestInvocation&amp; testInvocation)
-{
-    setCrashReportApplicationSpecificInformationToURL(testInvocation.url());
-}
-
</del><span class="cx"> static bool shouldUseThreadedScrolling(const TestInvocation&amp; test)
</span><span class="cx"> {
</span><span class="cx">     return test.urlContains(&quot;tiled-drawing/&quot;);
</span><span class="lines">@@ -85,15 +84,6 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::platformResetPreferencesToConsistentValues()
</span><span class="cx"> {
</span><del>-#if WK_API_ENABLED
-    __block bool doneRemoving = false;
-    [[_WKUserContentExtensionStore defaultStore] removeContentExtensionForIdentifier:@&quot;TestContentExtensions&quot; completionHandler:^(NSError *error)
-    {
-        doneRemoving = true;
-    }];
-    platformRunUntil(doneRemoving, 0);
-    [[_WKUserContentExtensionStore defaultStore] _removeAllContentExtensions];
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions&amp; viewOptions, const TestInvocation&amp; test) const
</span><span class="lines">@@ -121,7 +111,7 @@
</span><span class="cx">     [[_WKUserContentExtensionStore defaultStore] compileContentExtensionForIdentifier:@&quot;TestContentExtensions&quot; encodedContentExtension:contentExtensionString completionHandler:^(_WKUserContentFilter *filter, NSError *error)
</span><span class="cx">     {
</span><span class="cx">         if (!error)
</span><del>-            WKPageGroupAddUserContentFilter(WKPageGetPageGroup(TestController::singleton().mainWebView()-&gt;page()), (__bridge WKUserContentFilterRef)filter);
</del><ins>+            [mainWebView()-&gt;platformView().configuration.userContentController _addUserContentFilter:filter];
</ins><span class="cx">         else
</span><span class="cx">             NSLog(@&quot;%@&quot;, [error helpAnchor]);
</span><span class="cx">         doneCompiling = true;
</span><span class="lines">@@ -130,14 +120,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::platformRunUntil(bool&amp; done, double timeout)
-{
-    NSDate *endDate = (timeout &gt; 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture];
-
-    while (!done &amp;&amp; [endDate compare:[NSDate date]] == NSOrderedDescending)
-        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate];
-}
-
</del><span class="cx"> #if ENABLE(PLATFORM_FONT_LOOKUP)
</span><span class="cx"> static NSSet *allowedFontFamilySet()
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>