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