Title: [253743] trunk
Revision
253743
Author
[email protected]
Date
2019-12-19 01:34:31 -0800 (Thu, 19 Dec 2019)

Log Message

[WPE] Missing UIScriptController implementation
https://bugs.webkit.org/show_bug.cgi?id=200295

Patch by Carlos Garcia Campos <[email protected]> on 2019-12-19
Reviewed by Žan Doberšek.

Tools:

Add initial implementation of UIScriptController for WPE.

* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
* WebKitTestRunner/PlatformWPE.cmake:
* WebKitTestRunner/wpe/PlatformWebViewWPE.cpp:
(WTR::PlatformWebView::addToWindow):
(WTR::PlatformWebView::removeFromWindow):
* WebKitTestRunner/wpe/UIScriptControllerWPE.cpp: Added.
(WTR::UIScriptController::create):
(WTR::UIScriptControllerWPE::doAsyncTask):
(WTR::UIScriptControllerWPE::setContinuousSpellCheckingEnabled):
(WTR::UIScriptControllerWPE::copyText):
(WTR::UIScriptControllerWPE::dismissMenu):
(WTR::UIScriptControllerWPE::isShowingMenu const):
(WTR::UIScriptControllerWPE::activateAtPoint):
(WTR::UIScriptControllerWPE::simulateAccessibilitySettingsChangeNotification):
(WTR::UIScriptControllerWPE::removeViewFromWindow):
(WTR::UIScriptControllerWPE::addViewToWindow):
* WebKitTestRunner/wpe/UIScriptControllerWPE.h: Added.
* wpe/backends/ViewBackend.h:

LayoutTests:

Remove expectation of a test that is now passing.

* platform/wpe/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (253742 => 253743)


--- trunk/LayoutTests/ChangeLog	2019-12-19 09:03:07 UTC (rev 253742)
+++ trunk/LayoutTests/ChangeLog	2019-12-19 09:34:31 UTC (rev 253743)
@@ -1,3 +1,14 @@
+2019-12-19  Carlos Garcia Campos  <[email protected]>
+
+        [WPE] Missing UIScriptController implementation
+        https://bugs.webkit.org/show_bug.cgi?id=200295
+
+        Reviewed by Žan Doberšek.
+
+        Remove expectation of a test that is now passing.
+
+        * platform/wpe/TestExpectations:
+
 2019-12-19  youenn fablet  <[email protected]>
 
         Safari resumes autoplay audio elements after getUserMedia

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (253742 => 253743)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2019-12-19 09:03:07 UTC (rev 253742)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2019-12-19 09:34:31 UTC (rev 253743)
@@ -788,8 +788,6 @@
 
 webkit.org/b/199440 fast/mediastream/mediastreamtrack-video-clone.html [ Failure Timeout Crash ]
 
-webkit.org/b/200534 fast/events/focus-anchor-with-tabindex-hang.html [ Crash ]
-
 webkit.org/b/204112 editing/async-clipboard/clipboard-change-data-while-getting-type.html [ Crash ]
 webkit.org/b/204112 editing/async-clipboard/clipboard-change-data-while-reading.html [ Crash ]
 webkit.org/b/204112 editing/async-clipboard/clipboard-get-type-with-old-items.html [ Crash ]

Modified: trunk/Tools/ChangeLog (253742 => 253743)


--- trunk/Tools/ChangeLog	2019-12-19 09:03:07 UTC (rev 253742)
+++ trunk/Tools/ChangeLog	2019-12-19 09:34:31 UTC (rev 253743)
@@ -1,5 +1,33 @@
 2019-12-19  Carlos Garcia Campos  <[email protected]>
 
+        [WPE] Missing UIScriptController implementation
+        https://bugs.webkit.org/show_bug.cgi?id=200295
+
+        Reviewed by Žan Doberšek.
+
+        Add initial implementation of UIScriptController for WPE.
+
+        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+        * WebKitTestRunner/PlatformWPE.cmake:
+        * WebKitTestRunner/wpe/PlatformWebViewWPE.cpp:
+        (WTR::PlatformWebView::addToWindow):
+        (WTR::PlatformWebView::removeFromWindow):
+        * WebKitTestRunner/wpe/UIScriptControllerWPE.cpp: Added.
+        (WTR::UIScriptController::create):
+        (WTR::UIScriptControllerWPE::doAsyncTask):
+        (WTR::UIScriptControllerWPE::setContinuousSpellCheckingEnabled):
+        (WTR::UIScriptControllerWPE::copyText):
+        (WTR::UIScriptControllerWPE::dismissMenu):
+        (WTR::UIScriptControllerWPE::isShowingMenu const):
+        (WTR::UIScriptControllerWPE::activateAtPoint):
+        (WTR::UIScriptControllerWPE::simulateAccessibilitySettingsChangeNotification):
+        (WTR::UIScriptControllerWPE::removeViewFromWindow):
+        (WTR::UIScriptControllerWPE::addViewToWindow):
+        * WebKitTestRunner/wpe/UIScriptControllerWPE.h: Added.
+        * wpe/backends/ViewBackend.h:
+
+2019-12-19  Carlos Garcia Campos  <[email protected]>
+
         Unreviewed GTK gardening. Mark /webkit/WebKitWebsiteData/configuration as flaky
 
         * TestWebKitAPI/glib/TestExpectations.json:

Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (253742 => 253743)


--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp	2019-12-19 09:03:07 UTC (rev 253742)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp	2019-12-19 09:34:31 UTC (rev 253743)
@@ -58,7 +58,7 @@
     return nullptr;
 }
 
-#if !PLATFORM(GTK) && !PLATFORM(COCOA) && !PLATFORM(WIN)
+#if !PLATFORM(GTK) && !PLATFORM(COCOA) && !PLATFORM(WIN) && !PLATFORM(WPE)
 Ref<UIScriptController> UIScriptController::create(UIScriptContext& context)
 {
     return adoptRef(*new UIScriptController(context));

Modified: trunk/Tools/WebKitTestRunner/PlatformWPE.cmake (253742 => 253743)


--- trunk/Tools/WebKitTestRunner/PlatformWPE.cmake	2019-12-19 09:03:07 UTC (rev 253742)
+++ trunk/Tools/WebKitTestRunner/PlatformWPE.cmake	2019-12-19 09:34:31 UTC (rev 253743)
@@ -10,6 +10,7 @@
     ${WEBKIT_TESTRUNNER_DIR}/wpe/EventSenderProxyWPE.cpp
     ${WEBKIT_TESTRUNNER_DIR}/wpe/PlatformWebViewWPE.cpp
     ${WEBKIT_TESTRUNNER_DIR}/wpe/TestControllerWPE.cpp
+    ${WEBKIT_TESTRUNNER_DIR}/wpe/UIScriptControllerWPE.cpp
     ${WEBKIT_TESTRUNNER_DIR}/wpe/main.cpp
 )
 

Modified: trunk/Tools/WebKitTestRunner/wpe/PlatformWebViewWPE.cpp (253742 => 253743)


--- trunk/Tools/WebKitTestRunner/wpe/PlatformWebViewWPE.cpp	2019-12-19 09:03:07 UTC (rev 253742)
+++ trunk/Tools/WebKitTestRunner/wpe/PlatformWebViewWPE.cpp	2019-12-19 09:34:31 UTC (rev 253743)
@@ -84,10 +84,12 @@
 
 void PlatformWebView::addToWindow()
 {
+    m_window->addActivityState(wpe_view_activity_state_in_window);
 }
 
 void PlatformWebView::removeFromWindow()
 {
+    m_window->removeActivityState(wpe_view_activity_state_in_window);
 }
 
 void PlatformWebView::setWindowIsKey(bool windowIsKey)

Added: trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp (0 => 253743)


--- trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp	                        (rev 0)
+++ trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp	2019-12-19 09:34:31 UTC (rev 253743)
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * 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.
+ */
+
+#include "config.h"
+#include "UIScriptControllerWPE.h"
+
+#include "EventSenderProxy.h"
+#include "PlatformWebView.h"
+#include "TestController.h"
+#include "TextChecker.h"
+#include "UIScriptContext.h"
+#include <_javascript_Core/OpaqueJSString.h>
+#include <wtf/RunLoop.h>
+
+namespace WTR {
+
+Ref<UIScriptController> UIScriptController::create(UIScriptContext& context)
+{
+    return adoptRef(*new UIScriptControllerWPE(context));
+}
+
+void UIScriptControllerWPE::doAsyncTask(JSValueRef callback)
+{
+    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), callbackID] {
+        if (!m_context)
+            return;
+        m_context->asyncTaskComplete(callbackID);
+    });
+}
+
+void UIScriptControllerWPE::setContinuousSpellCheckingEnabled(bool enabled)
+{
+    WebKit::TextChecker::setContinuousSpellCheckingEnabled(enabled);
+}
+
+void UIScriptControllerWPE::copyText(JSStringRef)
+{
+    // FIXME: implement.
+}
+
+void UIScriptControllerWPE::dismissMenu()
+{
+    // FIXME: implement.
+}
+
+bool UIScriptControllerWPE::isShowingMenu() const
+{
+    // FIXME: implement.
+    return false;
+}
+
+void UIScriptControllerWPE::activateAtPoint(long x, long y, JSValueRef callback)
+{
+    auto* eventSender = TestController::singleton().eventSenderProxy();
+    if (!eventSender) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+
+    eventSender->mouseMoveTo(x, y);
+    eventSender->mouseDown(0, 0);
+    eventSender->mouseUp(0, 0);
+
+    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), callbackID] {
+        if (!m_context)
+            return;
+        m_context->asyncTaskComplete(callbackID);
+    });
+}
+
+void UIScriptControllerWPE::simulateAccessibilitySettingsChangeNotification(JSValueRef callback)
+{
+    // FIXME: implement.
+    doAsyncTask(callback);
+}
+
+void UIScriptControllerWPE::removeViewFromWindow(JSValueRef callback)
+{
+    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+    auto* mainWebView = TestController::singleton().mainWebView();
+    mainWebView->removeFromWindow();
+
+    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), callbackID] {
+        if (!m_context)
+            return;
+        m_context->asyncTaskComplete(callbackID);
+    });
+}
+
+void UIScriptControllerWPE::addViewToWindow(JSValueRef callback)
+{
+    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+    auto* mainWebView = TestController::singleton().mainWebView();
+    mainWebView->addToWindow();
+
+    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), callbackID] {
+        if (!m_context)
+            return;
+        m_context->asyncTaskComplete(callbackID);
+    });
+}
+
+} // namespace WTR

Added: trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.h (0 => 253743)


--- trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.h	                        (rev 0)
+++ trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.h	2019-12-19 09:34:31 UTC (rev 253743)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include "PlatformWebView.h"
+#include "TestController.h"
+#include "UIScriptController.h"
+
+namespace WTR {
+
+class UIScriptControllerWPE final : public UIScriptController {
+public:
+    explicit UIScriptControllerWPE(UIScriptContext& context)
+        : UIScriptController(context)
+    {
+    }
+
+    void doAsyncTask(JSValueRef) override;
+    void setContinuousSpellCheckingEnabled(bool) override;
+    void copyText(JSStringRef) override;
+    void dismissMenu() override;
+    bool isShowingMenu() const override;
+    void activateAtPoint(long x, long y, JSValueRef callback) override;
+    void simulateAccessibilitySettingsChangeNotification(JSValueRef) override;
+    void removeViewFromWindow(JSValueRef) override;
+    void addViewToWindow(JSValueRef) override;
+};
+
+} // namespace WTR

Modified: trunk/Tools/wpe/backends/ViewBackend.h (253742 => 253743)


--- trunk/Tools/wpe/backends/ViewBackend.h	2019-12-19 09:03:07 UTC (rev 253742)
+++ trunk/Tools/wpe/backends/ViewBackend.h	2019-12-19 09:34:31 UTC (rev 253743)
@@ -60,6 +60,8 @@
 #endif
 
     struct wpe_view_backend* backend() const;
+    void addActivityState(uint32_t);
+    void removeActivityState(uint32_t);
 
 protected:
     ViewBackend(uint32_t width, uint32_t height);
@@ -70,9 +72,6 @@
     void initializeAccessibility();
     void updateAccessibilityState(uint32_t);
 
-    void addActivityState(uint32_t);
-    void removeActivityState(uint32_t);
-
     void dispatchInputPointerEvent(struct wpe_input_pointer_event*);
     void dispatchInputAxisEvent(struct wpe_input_axis_event*);
     void dispatchInputKeyboardEvent(struct wpe_input_keyboard_event*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to