<!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>[188157] trunk/Tools</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/188157">188157</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-08-07 13:35:24 -0700 (Fri, 07 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Simplify WKTR's view options
https://bugs.webkit.org/show_bug.cgi?id=147791

Reviewed by Sam Weinig.

Instead of using a WKDictionaryRef, just use a struct for the options.

* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::options):
(WTR::PlatformWebView::viewSupportsOptions): Deleted.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::ensureViewSupportsOptions):
(WTR::TestController::updateLayoutTypeForTest):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/ViewOptions.h: Added.
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformConfigureViewForTest):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</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="#trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojectpbxproj">trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsWebKitTestRunnereflPlatformWebViewEflcpp">trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnergtkPlatformWebViewGtkcpp">trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosPlatformWebViewIOSmm">trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.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="#trunkToolsWebKitTestRunnerViewOptionsh">trunk/Tools/WebKitTestRunner/ViewOptions.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/ChangeLog        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-08-07  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Simplify WKTR's view options
+        https://bugs.webkit.org/show_bug.cgi?id=147791
+
+        Reviewed by Sam Weinig.
+
+        Instead of using a WKDictionaryRef, just use a struct for the options.
+
+        * WebKitTestRunner/PlatformWebView.h:
+        (WTR::PlatformWebView::options):
+        (WTR::PlatformWebView::viewSupportsOptions): Deleted.
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize):
+        (WTR::TestController::createWebViewWithOptions):
+        (WTR::TestController::ensureViewSupportsOptions):
+        (WTR::TestController::updateLayoutTypeForTest):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/ViewOptions.h: Added.
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+        * WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::platformConfigureViewForTest):
+
</ins><span class="cx"> 2015-08-07  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Running tests for a long time results in some tests running very slowly (throttling)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerPlatformWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/PlatformWebView.h        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef PlatformWebView_h
</span><span class="cx"> #define PlatformWebView_h
</span><span class="cx"> 
</span><ins>+#include &quot;ViewOptions.h&quot;
</ins><span class="cx"> #include &lt;WebKit/WKRetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if defined(__APPLE__) &amp;&amp; __APPLE__
</span><span class="lines">@@ -51,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx"> class PlatformWebView {
</span><span class="cx"> public:
</span><del>-    PlatformWebView(WKContextRef, WKPageGroupRef, WKPageRef relatedPage, WKDictionaryRef options = 0);
</del><ins>+    PlatformWebView(WKContextRef, WKPageGroupRef, WKPageRef relatedPage, const ViewOptions&amp;);
</ins><span class="cx">     ~PlatformWebView();
</span><span class="cx"> 
</span><span class="cx">     WKPageRef page();
</span><span class="lines">@@ -74,14 +75,10 @@
</span><span class="cx">     void setWindowIsKey(bool isKey) { m_windowIsKey = isKey; }
</span><span class="cx">     bool windowIsKey() const { return m_windowIsKey; }
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA) || PLATFORM(EFL)
-    bool viewSupportsOptions(WKDictionaryRef) const;
-#else
-    bool viewSupportsOptions(WKDictionaryRef) const { return true; }
-#endif
</del><ins>+    bool viewSupportsOptions(const ViewOptions&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     WKRetainPtr&lt;WKImageRef&gt; windowSnapshotImage();
</span><del>-    WKDictionaryRef options() const { return m_options.get(); }
</del><ins>+    const ViewOptions&amp; options() const { return m_options; }
</ins><span class="cx"> 
</span><span class="cx">     void changeWindowScaleIfNeeded(float newScale);
</span><span class="cx"> 
</span><span class="lines">@@ -95,7 +92,8 @@
</span><span class="cx">     PlatformWKView m_view;
</span><span class="cx">     PlatformWindow m_window;
</span><span class="cx">     bool m_windowIsKey;
</span><del>-    WKRetainPtr&lt;WKDictionaryRef&gt; m_options;
</del><ins>+    const ViewOptions m_options;
+
</ins><span class="cx"> #if PLATFORM(EFL)
</span><span class="cx">     bool m_usingFixedLayout;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -432,26 +432,14 @@
</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="cx"> 
</span><del>-    WKRetainPtr&lt;WKMutableDictionaryRef&gt; viewOptions;
-    if (m_shouldUseRemoteLayerTree) {
-        viewOptions = adoptWK(WKMutableDictionaryCreate());
-        WKRetainPtr&lt;WKStringRef&gt; useRemoteLayerTreeKey = adoptWK(WKStringCreateWithUTF8CString(&quot;RemoteLayerTree&quot;));
-        WKRetainPtr&lt;WKBooleanRef&gt; useRemoteLayerTreeValue = adoptWK(WKBooleanCreate(m_shouldUseRemoteLayerTree));
-        WKDictionarySetItem(viewOptions.get(), useRemoteLayerTreeKey.get(), useRemoteLayerTreeValue.get());
-    }
</del><ins>+    ViewOptions viewOptions;
+    viewOptions.useRemoteLayerTree = m_shouldUseRemoteLayerTree;
+    viewOptions.shouldShowWebView = m_shouldShowWebView;
</ins><span class="cx"> 
</span><del>-    if (m_shouldShowWebView) {
-        if (!viewOptions)
-            viewOptions = adoptWK(WKMutableDictionaryCreate());
-        WKRetainPtr&lt;WKStringRef&gt; shouldShowWebViewKey = adoptWK(WKStringCreateWithUTF8CString(&quot;ShouldShowWebView&quot;));
-        WKRetainPtr&lt;WKBooleanRef&gt; shouldShowWebViewValue = adoptWK(WKBooleanCreate(m_shouldShowWebView));
-        WKDictionarySetItem(viewOptions.get(), shouldShowWebViewKey.get(), shouldShowWebViewValue.get());
-    }
-
-    createWebViewWithOptions(viewOptions.get());
</del><ins>+    createWebViewWithOptions(viewOptions);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::createWebViewWithOptions(WKDictionaryRef options)
</del><ins>+void TestController::createWebViewWithOptions(const ViewOptions&amp; options)
</ins><span class="cx"> {
</span><span class="cx">     m_mainWebView = std::make_unique&lt;PlatformWebView&gt;(m_context.get(), m_pageGroup.get(), nullptr, options);
</span><span class="cx">     WKPageUIClientV5 pageUIClient = {
</span><span class="lines">@@ -554,7 +542,7 @@
</span><span class="cx">     m_mainWebView-&gt;changeWindowScaleIfNeeded(1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::ensureViewSupportsOptions(WKDictionaryRef options)
</del><ins>+void TestController::ensureViewSupportsOptions(const ViewOptions&amp; options)
</ins><span class="cx"> {
</span><span class="cx">     if (m_mainWebView &amp;&amp; !m_mainWebView-&gt;viewSupportsOptions(options)) {
</span><span class="cx">         WKPageSetPageUIClient(m_mainWebView-&gt;page(), 0);
</span><span class="lines">@@ -797,12 +785,11 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::updateLayoutTypeForTest(const TestInvocation&amp; test)
</span><span class="cx"> {
</span><del>-    auto viewOptions = adoptWK(WKMutableDictionaryCreate());
-    auto useFixedLayoutKey = adoptWK(WKStringCreateWithUTF8CString(&quot;UseFixedLayout&quot;));
-    auto useFixedLayoutValue = adoptWK(WKBooleanCreate(shouldUseFixedLayout(test)));
-    WKDictionarySetItem(viewOptions.get(), useFixedLayoutKey.get(), useFixedLayoutValue.get());
</del><ins>+    ViewOptions viewOptions;
</ins><span class="cx"> 
</span><del>-    ensureViewSupportsOptions(viewOptions.get());
</del><ins>+    viewOptions.useFixedLayout = shouldUseFixedLayout(test);
+
+    ensureViewSupportsOptions(viewOptions);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA) &amp;&amp; !PLATFORM(GTK)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> class TestInvocation;
</span><span class="cx"> class PlatformWebView;
</span><span class="cx"> class EventSenderProxy;
</span><ins>+struct ViewOptions;
</ins><span class="cx"> 
</span><span class="cx"> // FIXME: Rename this TestRunner?
</span><span class="cx"> class TestController {
</span><span class="lines">@@ -67,7 +68,7 @@
</span><span class="cx"> 
</span><span class="cx">     EventSenderProxy* eventSenderProxy() { return m_eventSenderProxy.get(); }
</span><span class="cx"> 
</span><del>-    void ensureViewSupportsOptions(WKDictionaryRef options);
</del><ins>+    void ensureViewSupportsOptions(const ViewOptions&amp;);
</ins><span class="cx">     bool shouldUseRemoteLayerTree() const { return m_shouldUseRemoteLayerTree; }
</span><span class="cx">     
</span><span class="cx">     // Runs the run loop until `done` is true or the timeout elapses.
</span><span class="lines">@@ -124,7 +125,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void initialize(int argc, const char* argv[]);
</span><del>-    void createWebViewWithOptions(WKDictionaryRef);
</del><ins>+    void createWebViewWithOptions(const ViewOptions&amp;);
</ins><span class="cx">     void run();
</span><span class="cx"> 
</span><span class="cx">     void runTestingServerLoop();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerViewOptionsh"></a>
<div class="addfile"><h4>Added: trunk/Tools/WebKitTestRunner/ViewOptions.h (0 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ViewOptions.h                                (rev 0)
+++ trunk/Tools/WebKitTestRunner/ViewOptions.h        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -0,0 +1,42 @@
</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.
+ */
+
+#ifndef ViewOptions_h
+#define ViewOptions_h
+
+namespace WTR {
+
+struct ViewOptions {
+    bool useThreadedScrolling { false };
+    bool useRemoteLayerTree { false };
+    bool shouldShowWebView { false };
+    bool useTiledDrawing { false };
+
+    bool useFixedLayout { false };
+};
+
+}
+
+#endif // ViewOptions_h
</ins></span></pre></div>
<a id="trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -147,6 +147,7 @@
</span><span class="cx">                 0FEB909E1905A776000FDBF3 /* InjectedBundlePageCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InjectedBundlePageCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FEB90A21905BC6A000FDBF3 /* CrashReporterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CrashReporterInfo.h; path = cocoa/CrashReporterInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CrashReporterInfo.mm; path = cocoa/CrashReporterInfo.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1A3326051B75396500F89F62 /* ViewOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewOptions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 26D758E5160BECDC00268472 /* GeolocationProviderMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationProviderMock.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26D758E6160BECDD00268472 /* GeolocationProviderMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationProviderMock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 29210EA2144CAAA500835BB5 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -361,6 +362,7 @@
</span><span class="cx">                                 BC79342F118F7F19005EA8E2 /* TestController.h */,
</span><span class="cx">                                 BCD7D2F711921278006DB7EE /* TestInvocation.cpp */,
</span><span class="cx">                                 BCD7D2F611921278006DB7EE /* TestInvocation.h */,
</span><ins>+                                1A3326051B75396500F89F62 /* ViewOptions.h */,
</ins><span class="cx">                                 BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */,
</span><span class="cx">                                 3164C8EF15D1ADA100EF1FE0 /* WebNotificationProvider.cpp */,
</span><span class="cx">                                 3110BE0F15BA011400D216AC /* WebNotificationProvider.h */,
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnereflPlatformWebViewEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -53,11 +53,11 @@
</span><span class="cx">     return ecoreEvas;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKPageRef /* relatedPage */, WKDictionaryRef options)
</del><ins>+PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKPageRef /* relatedPage */, const ViewOptions&amp; options)
</ins><span class="cx">     : m_options(options)
</span><span class="cx"> {
</span><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;UseFixedLayout&quot;));
</span><del>-    m_usingFixedLayout = options ? WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false;
</del><ins>+    m_usingFixedLayout = options.useFixedLayout;
</ins><span class="cx"> 
</span><span class="cx">     m_window = initEcoreEvas();
</span><span class="cx"> 
</span><span class="lines">@@ -142,11 +142,12 @@
</span><span class="cx">     return adoptWK(WKViewCreateSnapshot(EWKViewGetWKView(m_view)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
</del><ins>+bool PlatformWebView::viewSupportsOptions(const ViewOptions&amp; options) const
</ins><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;UseFixedLayout&quot;));
</del><ins>+    if (m_options.useFixedLayout != options.useFixedLayout)
+        return false;
</ins><span class="cx"> 
</span><del>-    return m_usingFixedLayout == (options ? WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false);
</del><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::didInitializeClients()
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnergtkPlatformWebViewGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -141,6 +141,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool PlatformWebView::viewSupportsOptions(const TestOptions&amp;) const
+{
+    return true;
+}
+
</ins><span class="cx"> void PlatformWebView::dismissAllPopupMenus()
</span><span class="cx"> {
</span><span class="cx">     // gtk_menu_popdown doesn't modify the GList of attached menus, so it should
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosPlatformWebViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -121,16 +121,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><del>-PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKPageRef relatedPage, WKDictionaryRef options)
</del><ins>+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKPageRef relatedPage, const ViewOptions&amp; options)
</ins><span class="cx">     : m_windowIsKey(true)
</span><span class="cx">     , m_options(options)
</span><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;TiledDrawing&quot;));
-    WKTypeRef useTiledDrawingValue = options ? WKDictionaryGetItemForKey(options, useTiledDrawingKey.get()) : NULL;
-    bool useTiledDrawing = useTiledDrawingValue &amp;&amp; WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(useTiledDrawingValue));
-
</del><span class="cx">     CGRect rect = CGRectMake(0, 0, TestController::viewWidth, TestController::viewHeight);
</span><del>-    m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:relatedPage useTiledDrawing:useTiledDrawing];
</del><ins>+    m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:relatedPage useTiledDrawing:m_options.useTiledDrawing];
</ins><span class="cx"> 
</span><span class="cx">     WKPreferencesSetCompositingBordersVisible(WKPageGroupGetPreferences(pageGroupRef), YES);
</span><span class="cx">     WKPreferencesSetCompositingRepaintCountersVisible(WKPageGroupGetPreferences(pageGroupRef), YES);
</span><span class="lines">@@ -229,13 +225,12 @@
</span><span class="cx">     return 0; // FIXME for iOS?
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
</del><ins>+bool PlatformWebView::viewSupportsOptions(cost ViewOptions&amp; options) const
</ins><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;TiledDrawing&quot;));
-    WKTypeRef useTiledDrawingValue = WKDictionaryGetItemForKey(options, useTiledDrawingKey.get());
-    bool useTiledDrawing = useTiledDrawingValue &amp;&amp; WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(useTiledDrawingValue));
</del><ins>+    if (m_options.useTiledDrawing != options.useTiledDrawing)
+        return false;
</ins><span class="cx"> 
</span><del>-    return useTiledDrawing == [(TestRunnerWKView *)m_view useTiledDrawing];
</del><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WTR
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacPlatformWebViewMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -119,40 +119,30 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><del>-PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKPageRef relatedPage, WKDictionaryRef options)
</del><ins>+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKPageRef relatedPage, const ViewOptions&amp; options)
</ins><span class="cx">     : m_windowIsKey(true)
</span><span class="cx">     , m_options(options)
</span><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; useThreadedScrollingKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;ThreadedScrolling&quot;));
-    WKRetainPtr&lt;WKStringRef&gt; useRemoteLayerTreeKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;RemoteLayerTree&quot;));
-    WKTypeRef useThreadedScrollingValue = options ? WKDictionaryGetItemForKey(options, useThreadedScrollingKey.get()) : NULL;
-    bool useThreadedScrolling = useThreadedScrollingValue &amp;&amp; WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(useThreadedScrollingValue));
-
</del><span class="cx">     // The tiled drawing specific tests also depend on threaded scrolling.
</span><span class="cx">     WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroupRef);
</span><del>-    WKPreferencesSetThreadedScrollingEnabled(preferences, useThreadedScrolling);
</del><ins>+    WKPreferencesSetThreadedScrollingEnabled(preferences, m_options.useThreadedScrolling);
</ins><span class="cx"> 
</span><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><del>-    WKTypeRef useRemoteLayerTreeValue = options ? WKDictionaryGetItemForKey(options, useRemoteLayerTreeKey.get()) : NULL;
-    if (useRemoteLayerTreeValue &amp;&amp; WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(useRemoteLayerTreeValue)))
</del><ins>+    if (m_options.useRemoteLayerTree)
</ins><span class="cx">         [[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@&quot;WebKit2UseRemoteLayerTreeDrawingArea&quot;];
</span><span class="cx"> 
</span><span class="cx">     NSRect rect = NSMakeRect(0, 0, TestController::viewWidth, TestController::viewHeight);
</span><del>-    m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:relatedPage useThreadedScrolling:useThreadedScrolling];
</del><ins>+    m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:relatedPage useThreadedScrolling:m_options.useThreadedScrolling];
</ins><span class="cx">     [m_view setWindowOcclusionDetectionEnabled:NO];
</span><span class="cx"> 
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; shouldShowWebViewKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;ShouldShowWebView&quot;));
-    WKTypeRef shouldShowWebViewValue = options ? WKDictionaryGetItemForKey(options, shouldShowWebViewKey.get()) : NULL;
-    bool shouldShowWebView = shouldShowWebViewValue &amp;&amp; WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(shouldShowWebViewValue));
-
</del><span class="cx">     NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0];
</span><del>-    NSRect windowRect = (shouldShowWebView) ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
</del><ins>+    NSRect windowRect = m_options.shouldShowWebView ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
</ins><span class="cx">     m_window = [[WebKitTestRunnerWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:(NSBackingStoreType)_NSBackingStoreUnbuffered defer:YES];
</span><span class="cx">     m_window.platformWebView = this;
</span><span class="cx">     [m_window setColorSpace:[firstScreen colorSpace]];
</span><span class="cx">     [m_window setCollectionBehavior:NSWindowCollectionBehaviorStationary];
</span><span class="cx">     [[m_window contentView] addSubview:m_view];
</span><del>-    if (shouldShowWebView)
</del><ins>+    if (m_options.shouldShowWebView)
</ins><span class="cx">         [m_window orderFront:nil];
</span><span class="cx">     else
</span><span class="cx">         [m_window orderBack:nil];
</span><span class="lines">@@ -249,13 +239,12 @@
</span><span class="cx">     return adoptWK(WKImageCreateFromCGImage(windowSnapshotImage.get(), 0));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
</del><ins>+bool PlatformWebView::viewSupportsOptions(const ViewOptions&amp; options) const
</ins><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; useThreadedScrollingKey(AdoptWK, WKStringCreateWithUTF8CString(&quot;ThreadedScrolling&quot;));
-    WKTypeRef useThreadedScrollingValue = WKDictionaryGetItemForKey(options, useThreadedScrollingKey.get());
-    bool useThreadedScrolling = useThreadedScrollingValue &amp;&amp; WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(useThreadedScrollingValue));
</del><ins>+    if (m_options.useThreadedScrolling != options.useThreadedScrolling)
+        return false;
</ins><span class="cx"> 
</span><del>-    return useThreadedScrolling == [(TestRunnerWKView *)m_view useThreadedScrolling];
</del><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformWebView::changeWindowScaleIfNeeded(float newScale)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacTestControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (188156 => 188157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2015-08-07 20:19:20 UTC (rev 188156)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2015-08-07 20:35:24 UTC (rev 188157)
</span><span class="lines">@@ -98,21 +98,14 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::platformConfigureViewForTest(const TestInvocation&amp; test)
</span><span class="cx"> {
</span><del>-    auto viewOptions = adoptWK(WKMutableDictionaryCreate());
-    auto useThreadedScrollingKey = adoptWK(WKStringCreateWithUTF8CString(&quot;ThreadedScrolling&quot;));
-    auto useThreadedScrollingValue = adoptWK(WKBooleanCreate(shouldUseThreadedScrolling(test)));
-    WKDictionarySetItem(viewOptions.get(), useThreadedScrollingKey.get(), useThreadedScrollingValue.get());
</del><ins>+    ViewOptions viewOptions;
</ins><span class="cx"> 
</span><del>-    auto useRemoteLayerTreeKey = adoptWK(WKStringCreateWithUTF8CString(&quot;RemoteLayerTree&quot;));
-    auto useRemoteLayerTreeValue = adoptWK(WKBooleanCreate(shouldUseRemoteLayerTree()));
-    WKDictionarySetItem(viewOptions.get(), useRemoteLayerTreeKey.get(), useRemoteLayerTreeValue.get());
</del><ins>+    viewOptions.useThreadedScrolling = shouldUseThreadedScrolling(test);
+    viewOptions.useRemoteLayerTree = shouldUseRemoteLayerTree();
+    viewOptions.shouldShowWebView = shouldShowWebView();
</ins><span class="cx"> 
</span><del>-    auto shouldShowWebViewKey = adoptWK(WKStringCreateWithUTF8CString(&quot;ShouldShowWebView&quot;));
-    auto shouldShowWebViewValue = adoptWK(WKBooleanCreate(shouldShowWebView()));
-    WKDictionarySetItem(viewOptions.get(), shouldShowWebViewKey.get(), shouldShowWebViewValue.get());
</del><ins>+    ensureViewSupportsOptions(viewOptions);
</ins><span class="cx"> 
</span><del>-    ensureViewSupportsOptions(viewOptions.get());
-
</del><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">     if (!test.urlContains(&quot;contentextensions/&quot;))
</span><span class="cx">         return;
</span></span></pre>
</div>
</div>

</body>
</html>