Title: [189668] trunk/Tools
Revision
189668
Author
mmaxfi...@apple.com
Date
2015-09-12 19:31:34 -0700 (Sat, 12 Sep 2015)

Log Message

[WKTR] Allow changing the WKContextConfiguration between successive tests
https://bugs.webkit.org/show_bug.cgi?id=148833

Reviewed by Tim Horton.

Previously, we were creating a single WKContext and it lived for the life of the entire test runner.
However, there are certain tests which require specifying options in this object. This patch makes
our existing code for recreating the test runner web view also recreate the WKContext.

As such, our options to the view are now options to the WKContextConfiguration. This patch renames the
class.

* WebKitTestRunner/ContextConfigurationOptions.h: Renamed from Tools/WebKitTestRunner/ViewOptions.h.
* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::options):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::generateContextConfiguration):
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::ensureViewSupportsOptionsForTest):
(WTR::updateContextConfigurationOptionsFromTestHeader):
(WTR::TestController::contextConfigurationOptionsForTest):
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
(WTR::updateViewOptionsFromTestHeader): Deleted.
(WTR::TestController::viewOptionsForTest): Deleted.
* WebKitTestRunner/TestController.h:
(WTR::TestController::injectedBundlePath):
(WTR::TestController::testPluginDirectory):
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/efl/TestControllerEfl.cpp:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
(WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Tools/ChangeLog (189667 => 189668)


--- trunk/Tools/ChangeLog	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/ChangeLog	2015-09-13 02:31:34 UTC (rev 189668)
@@ -1,3 +1,64 @@
+2015-09-12  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [WKTR] Allow changing the WKContextConfiguration between successive tests
+        https://bugs.webkit.org/show_bug.cgi?id=148833
+
+        Reviewed by Tim Horton.
+
+        Previously, we were creating a single WKContext and it lived for the life of the entire test runner.
+        However, there are certain tests which require specifying options in this object. This patch makes
+        our existing code for recreating the test runner web view also recreate the WKContext.
+
+        As such, our options to the view are now options to the WKContextConfiguration. This patch renames the
+        class.
+
+        * WebKitTestRunner/ContextConfigurationOptions.h: Renamed from Tools/WebKitTestRunner/ViewOptions.h.
+        * WebKitTestRunner/PlatformWebView.h:
+        (WTR::PlatformWebView::options):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::initialize):
+        (WTR::TestController::generateContextConfiguration):
+        (WTR::TestController::generatePageConfiguration):
+        (WTR::TestController::createWebViewWithOptions):
+        (WTR::TestController::ensureViewSupportsOptionsForTest):
+        (WTR::updateContextConfigurationOptionsFromTestHeader):
+        (WTR::TestController::contextConfigurationOptionsForTest):
+        (WTR::TestController::platformCreateWebView):
+        (WTR::TestController::platformCreateOtherPage):
+        (WTR::updateViewOptionsFromTestHeader): Deleted.
+        (WTR::TestController::viewOptionsForTest): Deleted.
+        * WebKitTestRunner/TestController.h:
+        (WTR::TestController::injectedBundlePath):
+        (WTR::TestController::testPluginDirectory):
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::TestController::platformCreateWebView):
+        (WTR::TestController::platformCreateOtherPage):
+        * WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/efl/TestControllerEfl.cpp:
+        (WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
+        (WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
+        * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/gtk/TestControllerGtk.cpp:
+        (WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
+        (WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
+        * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
+        (WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::PlatformWebView):
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::updatePlatformSpecificContextConfigurationOptionsForTest):
+        (WTR::TestController::updatePlatformSpecificViewOptionsForTest): Deleted.
+
 2015-09-11  Michael Saboff  <msab...@apple.com>
 
         LayoutTestHelper crashes if a color profile isn't set for a 3rd party monitor

Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/PlatformWebView.h	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h	2015-09-13 02:31:34 UTC (rev 189668)
@@ -26,7 +26,7 @@
 #ifndef PlatformWebView_h
 #define PlatformWebView_h
 
-#include "ViewOptions.h"
+#include "TestOptions.h"
 #include <WebKit/WKRetainPtr.h>
 
 #if PLATFORM(COCOA)
@@ -57,9 +57,9 @@
 class PlatformWebView {
 public:
 #if PLATFORM(COCOA)
-    PlatformWebView(WKWebViewConfiguration*, const ViewOptions&);
+    PlatformWebView(WKWebViewConfiguration*, const TestOptions&);
 #else
-    PlatformWebView(WKPageConfigurationRef, const ViewOptions&);
+    PlatformWebView(WKPageConfigurationRef, const TestOptions&);
 #endif
     ~PlatformWebView();
 
@@ -80,10 +80,10 @@
     void setWindowIsKey(bool isKey) { m_windowIsKey = isKey; }
     bool windowIsKey() const { return m_windowIsKey; }
 
-    bool viewSupportsOptions(const ViewOptions&) const;
+    bool viewSupportsOptions(const TestOptions&) const;
 
     WKRetainPtr<WKImageRef> windowSnapshotImage();
-    const ViewOptions& options() const { return m_options; }
+    const TestOptions& options() const { return m_options; }
 
     void changeWindowScaleIfNeeded(float newScale);
     void setNavigationGesturesEnabled(bool);
@@ -98,7 +98,7 @@
     PlatformWKView m_view;
     PlatformWindow m_window;
     bool m_windowIsKey;
-    const ViewOptions m_options;
+    const TestOptions m_options;
 
 #if PLATFORM(EFL)
     bool m_usingFixedLayout;

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2015-09-13 02:31:34 UTC (rev 189668)
@@ -368,7 +368,10 @@
 
     WKRetainPtr<WKStringRef> pageGroupIdentifier(AdoptWK, WKStringCreateWithUTF8CString("WebKitTestRunnerPageGroup"));
     m_pageGroup.adopt(WKPageGroupCreateWithIdentifier(pageGroupIdentifier.get()));
+}
 
+WKRetainPtr<WKContextConfigurationRef> TestController::generateContextConfiguration() const
+{
     auto configuration = adoptWK(WKContextConfigurationCreate());
     WKContextConfigurationSetInjectedBundlePath(configuration.get(), injectedBundlePath());
     WKContextConfigurationSetFullySynchronousModeIsAllowedForTesting(configuration.get(), true);
@@ -385,8 +388,13 @@
         WKContextConfigurationSetWebSQLDatabaseDirectory(configuration.get(), toWK(temporaryFolder + separator + "Databases" + separator + "WebSQL").get());
         WKContextConfigurationSetMediaKeysStorageDirectory(configuration.get(), toWK(temporaryFolder + separator + "MediaKeys").get());
     }
-    m_context = platformAdjustContext(adoptWK(WKContextCreateWithConfiguration(configuration.get())).get(), configuration.get());
+    return configuration;
+}
 
+WKRetainPtr<WKPageConfigurationRef> TestController::generatePageConfiguration(WKContextConfigurationRef configuration)
+{
+    m_context = platformAdjustContext(adoptWK(WKContextCreateWithConfiguration(configuration)).get(), configuration);
+
     m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get());
 
 #if PLATFORM(EFL)
@@ -445,18 +453,24 @@
     if (m_forceComplexText)
         WKContextSetAlwaysUsesComplexTextCodePath(m_context.get(), true);
 
-    m_configuration = adoptWK(WKPageConfigurationCreate());
-    WKPageConfigurationSetContext(m_configuration.get(), m_context.get());
-    WKPageConfigurationSetPageGroup(m_configuration.get(), m_pageGroup.get());
-    WKPageConfigurationSetUserContentController(m_configuration.get(), adoptWK(WKUserContentControllerCreate()).get());
+    auto pageConfiguration = adoptWK(WKPageConfigurationCreate());
+    WKPageConfigurationSetContext(pageConfiguration.get(), m_context.get());
+    WKPageConfigurationSetPageGroup(pageConfiguration.get(), m_pageGroup.get());
+    WKPageConfigurationSetUserContentController(pageConfiguration.get(), adoptWK(WKUserContentControllerCreate()).get());
+    return pageConfiguration;
+}
 
+void TestController::createWebViewWithOptions(const TestOptions& options)
+{
+    auto contextConfiguration = generateContextConfiguration();
+    // Modify contextConfiguration here.
+    auto configuration = generatePageConfiguration(contextConfiguration.get());
+
     // Some preferences (notably mock scroll bars setting) currently cannot be re-applied to an existing view, so we need to set them now.
+    // FIXME: Migrate these preferences to WKContextConfigurationRef.
     resetPreferencesToConsistentValues();
-}
 
-void TestController::createWebViewWithOptions(const ViewOptions& options)
-{
-    platformCreateWebView(m_configuration.get(), options);
+    platformCreateWebView(configuration.get(), options);
     WKPageUIClientV6 pageUIClient = {
         { 6, m_mainWebView.get() },
         0, // createNewPage_deprecatedForUseWithV0
@@ -564,10 +578,10 @@
 
 void TestController::ensureViewSupportsOptionsForTest(const TestInvocation& test)
 {
-    auto viewOptions = viewOptionsForTest(test);
+    auto options = testOptionsForTest(test);
 
     if (m_mainWebView) {
-        if (m_mainWebView->viewSupportsOptions(viewOptions))
+        if (m_mainWebView->viewSupportsOptions(options))
             return;
 
         WKPageSetPageUIClient(m_mainWebView->page(), nullptr);
@@ -577,7 +591,7 @@
         m_mainWebView = nullptr;
     }
 
-    createWebViewWithOptions(viewOptions);
+    createWebViewWithOptions(options);
 
     if (!resetStateToConsistentValues())
         TestInvocation::dumpWebProcessUnresponsiveness("<unknown> - TestController::run - Failed to reset state to consistent values\n");
@@ -808,7 +822,7 @@
     return std::string();
 }
 
-static void updateViewOptionsFromTestHeader(ViewOptions& viewOptions, const TestInvocation& test)
+static void updateTestOptionsFromTestHeader(TestOptions& testOptions, const TestInvocation& test)
 {
     std::string filename = testPath(test.url());
     if (filename.empty())
@@ -842,24 +856,24 @@
         }
         auto key = pairString.substr(pairStart, equalsLocation - pairStart);
         auto value = pairString.substr(equalsLocation + 1, pairEnd - (equalsLocation + 1));
-        // Options processing to modify viewOptions goes here.
+        // Options processing to modify testOptions goes here.
         pairStart = pairEnd + 1;
     }
 }
 
-ViewOptions TestController::viewOptionsForTest(const TestInvocation& test) const
+TestOptions TestController::testOptionsForTest(const TestInvocation& test) const
 {
-    ViewOptions viewOptions;
+    TestOptions options;
 
-    viewOptions.useRemoteLayerTree = m_shouldUseRemoteLayerTree;
-    viewOptions.shouldShowWebView = m_shouldShowWebView;
-    viewOptions.useFixedLayout = shouldUseFixedLayout(test);
+    options.useRemoteLayerTree = m_shouldUseRemoteLayerTree;
+    options.shouldShowWebView = m_shouldShowWebView;
+    options.useFixedLayout = shouldUseFixedLayout(test);
 
-    updateViewOptionsFromTestHeader(viewOptions, test);
+    updateTestOptionsFromTestHeader(options, test);
 
-    updatePlatformSpecificViewOptionsForTest(viewOptions, test);
+    updatePlatformSpecificTestOptionsForTest(options, test);
 
-    return viewOptions;
+    return options;
 }
 
 void TestController::updateWebViewSizeForTest(const TestInvocation& test)
@@ -1767,12 +1781,12 @@
 {
 }
 
-void TestController::platformCreateWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
+void TestController::platformCreateWebView(WKPageConfigurationRef configuration, const TestOptions& options)
 {
     m_mainWebView = std::make_unique<PlatformWebView>(configuration, options);
 }
 
-PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef configuration, const ViewOptions& options)
+PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef configuration, const TestOptions& options)
 {
     return new PlatformWebView(configuration, options);
 }

Modified: trunk/Tools/WebKitTestRunner/TestController.h (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/TestController.h	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2015-09-13 02:31:34 UTC (rev 189668)
@@ -41,7 +41,7 @@
 class TestInvocation;
 class PlatformWebView;
 class EventSenderProxy;
-struct ViewOptions;
+struct TestOptions;
 
 // FIXME: Rename this TestRunner?
 class TestController {
@@ -62,8 +62,8 @@
 
     bool verbose() const { return m_verbose; }
 
-    WKStringRef injectedBundlePath() { return m_injectedBundlePath.get(); }
-    WKStringRef testPluginDirectory() { return m_testPluginDirectory.get(); }
+    WKStringRef injectedBundlePath() const { return m_injectedBundlePath.get(); }
+    WKStringRef testPluginDirectory() const { return m_testPluginDirectory.get(); }
 
     PlatformWebView* mainWebView() { return m_mainWebView.get(); }
     WKContextRef context() { return m_context.get(); }
@@ -129,8 +129,10 @@
     void setNavigationGesturesEnabled(bool value);
 
 private:
+    WKRetainPtr<WKPageConfigurationRef> generatePageConfiguration(WKContextConfigurationRef);
+    WKRetainPtr<WKContextConfigurationRef> generateContextConfiguration() const;
     void initialize(int argc, const char* argv[]);
-    void createWebViewWithOptions(const ViewOptions&);
+    void createWebViewWithOptions(const TestOptions&);
     void run();
 
     void runTestingServerLoop();
@@ -140,8 +142,8 @@
     void platformDestroy();
     WKContextRef platformAdjustContext(WKContextRef, WKContextConfigurationRef);
     void platformInitializeContext();
-    void platformCreateWebView(WKPageConfigurationRef, const ViewOptions&);
-    static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions&);
+    void platformCreateWebView(WKPageConfigurationRef, const TestOptions&);
+    static PlatformWebView* platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const TestOptions&);
     void platformResetPreferencesToConsistentValues();
     void platformResetStateToConsistentValues();
 #if PLATFORM(COCOA)
@@ -156,8 +158,8 @@
     void initializeTestPluginDirectory();
 
     void ensureViewSupportsOptionsForTest(const TestInvocation&);
-    ViewOptions viewOptionsForTest(const TestInvocation&) const;
-    void updatePlatformSpecificViewOptionsForTest(ViewOptions&, const TestInvocation&) const;
+    TestOptions testOptionsForTest(const TestInvocation&) const;
+    void updatePlatformSpecificTestOptionsForTest(TestOptions&, const TestInvocation&) const;
 
     void updateWebViewSizeForTest(const TestInvocation&);
     void updateWindowScaleForTest(PlatformWebView*, const TestInvocation&);
@@ -258,7 +260,6 @@
     std::unique_ptr<PlatformWebView> m_mainWebView;
     WKRetainPtr<WKContextRef> m_context;
     WKRetainPtr<WKPageGroupRef> m_pageGroup;
-    WKRetainPtr<WKPageConfigurationRef> m_configuration;
 
     enum State {
         Initial,

Copied: trunk/Tools/WebKitTestRunner/TestOptions.h (from rev 189667, trunk/Tools/WebKitTestRunner/ViewOptions.h) (0 => 189668)


--- trunk/Tools/WebKitTestRunner/TestOptions.h	                        (rev 0)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h	2015-09-13 02:31:34 UTC (rev 189668)
@@ -0,0 +1,41 @@
+/*
+ * 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 TestOptions_h
+#define TestOptions_h
+
+namespace WTR {
+
+struct TestOptions {
+    bool useThreadedScrolling { false };
+    bool useRemoteLayerTree { false };
+    bool shouldShowWebView { false };
+
+    bool useFixedLayout { false };
+};
+
+}
+
+#endif // TestOptions_h

Property changes: trunk/Tools/WebKitTestRunner/TestOptions.h


Added: svn:keywords

Added: svn:eol-style

Deleted: trunk/Tools/WebKitTestRunner/ViewOptions.h (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/ViewOptions.h	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/ViewOptions.h	2015-09-13 02:31:34 UTC (rev 189668)
@@ -1,42 +0,0 @@
-/*
- * 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 (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj	2015-09-13 02:31:34 UTC (rev 189668)
@@ -164,7 +164,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>"; };
+		1A3326051B75396500F89F62 /* TestOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestOptions.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>"; };
@@ -383,7 +383,7 @@
 				BC79342F118F7F19005EA8E2 /* TestController.h */,
 				BCD7D2F711921278006DB7EE /* TestInvocation.cpp */,
 				BCD7D2F611921278006DB7EE /* TestInvocation.h */,
-				1A3326051B75396500F89F62 /* ViewOptions.h */,
+				1A3326051B75396500F89F62 /* TestOptions.h */,
 				BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */,
 				3164C8EF15D1ADA100EF1FE0 /* WebNotificationProvider.cpp */,
 				3110BE0F15BA011400D216AC /* WebNotificationProvider.h */,

Modified: trunk/Tools/WebKitTestRunner/WebNotificationProvider.cpp (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/WebNotificationProvider.cpp	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/WebNotificationProvider.cpp	2015-09-13 02:31:34 UTC (rev 189668)
@@ -65,8 +65,8 @@
 
 WebNotificationProvider::~WebNotificationProvider()
 {
-    if (m_notificationManager)
-        WKNotificationManagerSetProvider(m_notificationManager.get(), nullptr);
+    if (m_currentNotificationManager)
+        WKNotificationManagerSetProvider(m_currentNotificationManager.get(), nullptr);
 }
 
 WKNotificationProviderV0 WebNotificationProvider::provider()
@@ -86,19 +86,19 @@
 
 void WebNotificationProvider::showWebNotification(WKPageRef, WKNotificationRef notification)
 {
-    if (!m_notificationManager)
+    if (!m_currentNotificationManager)
         return;
 
     uint64_t id = WKNotificationGetID(notification);
     ASSERT(!m_shownNotifications.contains(id));
     m_shownNotifications.add(id);
 
-    WKNotificationManagerProviderDidShowNotification(m_notificationManager.get(), WKNotificationGetID(notification));
+    WKNotificationManagerProviderDidShowNotification(m_currentNotificationManager.get(), WKNotificationGetID(notification));
 }
 
 void WebNotificationProvider::closeWebNotification(WKNotificationRef notification)
 {
-    if (!m_notificationManager)
+    if (!m_currentNotificationManager)
         return;
 
     uint64_t id = WKNotificationGetID(notification);
@@ -106,22 +106,16 @@
     WKRetainPtr<WKMutableArrayRef> array(AdoptWK, WKMutableArrayCreate());
     WKArrayAppendItem(array.get(), wkID.get());
     m_shownNotifications.remove(id);
-    WKNotificationManagerProviderDidCloseNotifications(m_notificationManager.get(), array.get());
+    WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get());
 }
 
 void WebNotificationProvider::addNotificationManager(WKNotificationManagerRef manager)
 {
-    // We assume there is only one for testing.
-    ASSERT(!m_notificationManager);
-    m_notificationManager = manager;
+    m_currentNotificationManager = manager;
 }
 
 void WebNotificationProvider::removeNotificationManager(WKNotificationManagerRef manager)
 {
-    // We assume there is only one for testing.
-    ASSERT(m_notificationManager);
-    ASSERT(m_notificationManager.get() == manager);
-    m_notificationManager = 0;
 }
 
 WKDictionaryRef WebNotificationProvider::notificationPermissions()
@@ -132,16 +126,16 @@
 
 void WebNotificationProvider::simulateWebNotificationClick(uint64_t notificationID)
 {
-    if (!m_notificationManager)
+    if (!m_currentNotificationManager)
         return;
 
     ASSERT(m_shownNotifications.contains(notificationID));
-    WKNotificationManagerProviderDidClickNotification(m_notificationManager.get(), notificationID);
+    WKNotificationManagerProviderDidClickNotification(m_currentNotificationManager.get(), notificationID);
 }
 
 void WebNotificationProvider::reset()
 {
-    if (!m_notificationManager) {
+    if (!m_currentNotificationManager) {
         m_shownNotifications.clear();
         return;
     }
@@ -154,7 +148,7 @@
     }
 
     m_shownNotifications.clear();
-    WKNotificationManagerProviderDidCloseNotifications(m_notificationManager.get(), array.get());
+    WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get());
 }
 
 } // namespace WTR

Modified: trunk/Tools/WebKitTestRunner/WebNotificationProvider.h (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/WebNotificationProvider.h	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/WebNotificationProvider.h	2015-09-13 02:31:34 UTC (rev 189668)
@@ -49,7 +49,7 @@
     void reset();
 
 private:
-    WKRetainPtr<WKNotificationManagerRef> m_notificationManager;
+    WKRetainPtr<WKNotificationManagerRef> m_currentNotificationManager;
     HashSet<uint64_t> m_shownNotifications;
 };
 

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2015-09-13 02:31:34 UTC (rev 189668)
@@ -50,10 +50,10 @@
 void initializeWebViewConfiguration(const char* libraryPath, WKStringRef injectedBundlePath, WKContextRef context, WKContextConfigurationRef contextConfiguration)
 {
 #if WK_API_ENABLED
-    ASSERT(!globalWebViewConfiguration);
+    [globalWebViewConfiguration release];
     globalWebViewConfiguration = [[WKWebViewConfiguration alloc] init];
 
-    globalWebViewConfiguration.processPool = [[WKProcessPool alloc] _initWithConfiguration:(_WKProcessPoolConfiguration *)contextConfiguration];
+    globalWebViewConfiguration.processPool = WTF::adoptNS([[WKProcessPool alloc] _initWithConfiguration:(_WKProcessPoolConfiguration *)contextConfiguration]).get();
     globalWebViewConfiguration.websiteDataStore = (WKWebsiteDataStore *)WKContextGetWebsiteDataStore(context);
 
 #if TARGET_OS_IPHONE
@@ -74,12 +74,12 @@
 #endif
 }
 
-void TestController::platformCreateWebView(WKPageConfigurationRef, const ViewOptions& options)
+void TestController::platformCreateWebView(WKPageConfigurationRef, const TestOptions& options)
 {
     m_mainWebView = std::make_unique<PlatformWebView>(globalWebViewConfiguration, options);
 }
 
-PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const ViewOptions& options)
+PlatformWebView* TestController::platformCreateOtherPage(PlatformWebView* parentView, WKPageConfigurationRef, const TestOptions& options)
 {
 #if WK_API_ENABLED
     WKWebViewConfiguration *newConfiguration = [[globalWebViewConfiguration copy] autorelease];

Modified: trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp	2015-09-13 02:31:34 UTC (rev 189668)
@@ -53,7 +53,7 @@
     return ecoreEvas;
 }
 
-PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
+PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const TestOptions& options)
     : m_options(options)
 {
     WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout"));
@@ -144,7 +144,7 @@
     return adoptWK(WKViewCreateSnapshot(EWKViewGetWKView(m_view)));
 }
 
-bool PlatformWebView::viewSupportsOptions(const ViewOptions& options) const
+bool PlatformWebView::viewSupportsOptions(const TestOptions& options) const
 {
     if (m_options.useFixedLayout != options.useFixedLayout)
         return false;

Modified: trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp	2015-09-13 02:31:34 UTC (rev 189668)
@@ -148,9 +148,9 @@
     return false;
 }
 
-void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions& viewOptions, const TestInvocation& test) const
+void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions& testOptions, const TestInvocation& test) const
 {
-    viewOptions.useFixedLayout = shouldUseFixedLayout(test);
+    testOptions.useFixedLayout = shouldUseFixedLayout(test);
 }
 
 void TestController::platformConfigureViewForTest(const TestInvocation&)

Modified: trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp	2015-09-13 02:31:34 UTC (rev 189668)
@@ -36,7 +36,7 @@
 
 namespace WTR {
 
-PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
+PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const TestOptions& options)
     : m_view(WKViewCreate(configuration))
     , m_window(gtk_window_new(GTK_WINDOW_POPUP))
     , m_windowIsKey(true)
@@ -142,7 +142,7 @@
 {
 }
 
-bool PlatformWebView::viewSupportsOptions(const ViewOptions&) const
+bool PlatformWebView::viewSupportsOptions(const TestOptions&) const
 {
     return true;
 }

Modified: trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp	2015-09-13 02:31:34 UTC (rev 189668)
@@ -128,7 +128,7 @@
     m_mainWebView->dismissAllPopupMenus();
 }
 
-void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions&, const TestInvocation&) const
+void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions&, const TestInvocation&) const
 {
 }
 

Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm	2015-09-13 02:31:34 UTC (rev 189668)
@@ -100,7 +100,7 @@
 
 namespace WTR {
 
-PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions& options)
+PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const TestOptions& options)
     : m_windowIsKey(true)
     , m_options(options)
 {
@@ -202,7 +202,7 @@
     return nullptr;
 }
 
-bool PlatformWebView::viewSupportsOptions(const ViewOptions& options) const
+bool PlatformWebView::viewSupportsOptions(const TestOptions& options) const
 {
     return true;
 }

Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2015-09-13 02:31:34 UTC (rev 189668)
@@ -102,7 +102,7 @@
     }
 }
 
-void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions&, const TestInvocation&) const
+void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions&, const TestInvocation&) const
 {
 }
 

Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2015-09-13 02:31:34 UTC (rev 189668)
@@ -114,7 +114,7 @@
 
 namespace WTR {
 
-PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const ViewOptions& options)
+PlatformWebView::PlatformWebView(WKWebViewConfiguration* configuration, const TestOptions& options)
     : m_windowIsKey(true)
     , m_options(options)
 {
@@ -240,7 +240,7 @@
     return adoptWK(WKImageCreateFromCGImage(windowSnapshotImage.get(), 0));
 }
 
-bool PlatformWebView::viewSupportsOptions(const ViewOptions& options) const
+bool PlatformWebView::viewSupportsOptions(const TestOptions& options) const
 {
     if (m_options.useThreadedScrolling != options.useThreadedScrolling)
         return false;

Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (189667 => 189668)


--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2015-09-13 01:14:08 UTC (rev 189667)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2015-09-13 02:31:34 UTC (rev 189668)
@@ -95,11 +95,11 @@
     }
 }
 
-void TestController::updatePlatformSpecificViewOptionsForTest(ViewOptions& viewOptions, const TestInvocation& test) const
+void TestController::updatePlatformSpecificTestOptionsForTest(TestOptions& options, const TestInvocation& test) const
 {
-    viewOptions.useThreadedScrolling = shouldUseThreadedScrolling(test);
-    viewOptions.useRemoteLayerTree = shouldUseRemoteLayerTree();
-    viewOptions.shouldShowWebView = shouldShowWebView();
+    options.useThreadedScrolling = shouldUseThreadedScrolling(test);
+    options.useRemoteLayerTree = shouldUseRemoteLayerTree();
+    options.shouldShowWebView = shouldShowWebView();
 }
 
 void TestController::platformConfigureViewForTest(const TestInvocation& test)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to